Question with cpp and token pasting

Bob Ringo bringo at locus.com
Thu Jan 31 10:27:40 AEST 1991


Hi, this is probably a simple task, but I haven't figured it out.
I'd like to do the following:

#define A "Good"
#define B "Morning"
#define C   /* the concatenation of A and B */


--I tried the following, but it didn't work.

#define paste(x,y)  x ## y
#define A "Good"
#deifne B "Morning"
#define C paste(A,B)


Any Hints?


-- 
Bob Ringo
Locus Computing Corporation
bringo at locus.com



More information about the Comp.lang.c mailing list