Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!purdue!mailrus!cornell!uw-beaver!tikal!ole!ray From: ray@ole.UUCP (Ray Berry) Newsgroups: comp.lang.c Subject: Preprocessor question Message-ID: <531@ole.UUCP> Date: 18 Jan 89 22:32:44 GMT Distribution: na Organization: Seattle Silicon Corp., Bellevue, WA. Lines: 18 Here's an easy question regarding preprocessor string-izing and subsequent rescanning... #define VAL 3 #define STR(x) #x . . puts("val is " STR(VAL)); - - - - - - - - Turbo C produces "3" for STR(VAL); Microsoft produces "VAL" and leaves it at that. Which behavior is correct? Further, if Microsoft's is correct, how can one parenthesize a #define'd value to turn it into a character string? -- Ray Berry KB7HT uucp: ...{uw-beaver|uiucuxc}tikal!ole!ray CS: 73407,3152 Seattle Silicon Corp. 3075 112th Ave NE. Bellevue WA 98004 (206) 828 4422