Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site elsie.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!hplabs!hao!seismo!rlgvax!cvl!elsie!ado From: ado@elsie.UUCP Newsgroups: net.lang.c Subject: Re: Preprocessor Trickery Message-ID: <1014@elsie.UUCP> Date: Wed, 11-Jul-84 10:48:15 EDT Article-I.D.: elsie.1014 Posted: Wed Jul 11 10:48:15 1984 Date-Received: Sat, 14-Jul-84 01:25:20 EDT References: <199@haddock.UUCP> Organization: NIH-LEC, Bethesda, MD Lines: 19 > For concatenating strings at preprocessor time, try this: > > #define Ident(xxx) xxx > > #define concat(a,b) Ident(a)b > > It should always work. . . "Always"? How about if either "a" or "b" is "__LINE__"? Try typing this to see what happens: cc -E - #define Ident(xxx) xxx #define concat(a,b) Ident(a)b __LINE__ concat(__LINE__,__LINE__) -- ...decvax!allegra!umcp-cs!elsie!ado (301) 496-5688 (the DEC and VAX in decvax are Digital Equipment Corporation trademarks)