Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!flaps Newsgroups: comp.std.c From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: Re: (char *)(-1) Message-ID: <1989Aug4.122059.22859@jarvis.csri.toronto.edu> Keywords: pointers, casts References: <2619@yunexus.UUCP> <388@celit.UUCP> <118@psitech.UUCP> <1063@tukki.jyu.fi> <1282@cbnewsl.ATT.COM> <617@prles2.UUCP> <8872@june.cs.washington.edu> Date: 4 Aug 89 16:21:00 GMT pardo@june.cs.washington.edu (David Keppel) writes: > char const magic_1 = 'j'; > static char const terminator[] = "unk"; > #define MAGIC_1 (&magic_1) > >Then `return (MAGIC_1);'. *If* the implementation gives you >contiguous layout, then dereferencing `MAGIC_1' will give you `junk'... Of course, there is a way to request contiguous layout in C: char magic_1[] = "junk"; #define MAGIC_1 magic_1