Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Null revisited (briefly) Keywords: NULL Message-ID: <1095@auspex.UUCP> Date: 1 Mar 89 18:48:49 GMT References: <13068@steinmetz.ge.com> <102@servio.UUCP> <10138@socslgw.csl.sony.JUNET> <1783@dlvax2.datlog.co.uk> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 28 >>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. Wanna bet? The May 13, 1988 dpANS says: 3.1.3.4 Character constants ... Description An integer character constant is a sequence of one or more multibyte characters enclosed in single quotes, as in 'x' or 'ab'. A wide character constant is the same except prefixed by the letter L. ... Semantics An integer character constant has type "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. Wrong. '\0' *is* the same as 0.