Path: utzoo!attcan!uunet!mcvax!ukc!stl!stc!datlog!scm From: scm@datlog.co.uk ( Steve Mawer ) Newsgroups: comp.lang.c Subject: Re: Null revisited (briefly) Keywords: NULL Message-ID: <1783@dlvax2.datlog.co.uk> Date: 27 Feb 89 08:50:49 GMT References: <13068@steinmetz.ge.com> <102@servio.UUCP> <10138@socslgw.csl.sony.JUNET> Reply-To: scm@datlog.co.uk ( Steve Mawer ) Organization: Data Logic Ltd, Queens House, Greenhill Way, Harrow, London. Lines: 19 In article <10138@socslgw.csl.sony.JUNET> diamond@diamond. (Norman Diamond) writes: > >When you assign 'x' to a character, you are assigning an int to a >character. The reader knows that the type mismatch was intentional. Not if he knows the C language. A single character written within single quotes is a *character constant*. This isn't an int. '\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. It should, however, be noted that some compilers will allow the use of multiple characters, as in 'abcd' (which *may* work on 32 bit machines). I wouldn't recommend this usage in portable software. (In fact I wouldn't *ever* do it. Well, maybe just to try it :-)) -- Steve C. Mawer or < {backbone}!ukc!datlog!scm > Voice: +44 1 863 0383 (x2153)