Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ulowell!masscomp!ftw From: ftw@masscomp.UUCP (Farrell Woods) Newsgroups: comp.lang.c Subject: Re: Null revisited (briefly) Keywords: NULL Message-ID: <772@masscomp.UUCP> Date: 2 Mar 89 16:54:17 GMT References: <13068@steinmetz.ge.com> <102@servio.UUCP> <10138@socslgw.csl.sony.JUNET> <1783@dlvax2.datlog.co.uk> Reply-To: ftw@quasar.masscomp.UUCP (Farrell Woods) Organization: Concurrent Computer Corporation - Westford, Ma Lines: 32 In article <1783@dlvax2.datlog.co.uk> scm@datlog.co.uk ( Steve Mawer ) writes: >A single character written within >single quotes is a *character constant*. This isn't an int. Wrong! >'\0' is a special case to permit the representation of non-graphical >characters (also newline, tab, backslash, return, etc.) and is not >the same as 0, which is an integer constant. Absolutely WRONG! I strongly suggest you try this on your favorite compiler: main(ac, av) int ac; char **av; { printf("repeat after me: sizeof ('x') == %d\n", sizeof ('x')); printf(" sizeof ('\\0') == %d\n", sizeof ('\0')); printf(" sizeof (int) == %d\n", sizeof (int)); printf("if these are not all the same, your compiler is broken!\n"); exit(0); } Study the results carfully... -- Farrell T. Woods Voice: (508) 692-6200 x2471 MASSCOMP Operating Systems Group Internet: ftw@masscomp.com 1 Technology Way uucp: {backbones}!masscomp!ftw Westford, MA 01886 OS/2: Half an operating system