ANSI C and the C Pre-Processor

Henry Spencer henry at utzoo.UUCP
Sun Sep 30 09:25:38 AEST 1984


>   ............................ One proposal is to do the substitution
>   if the argument name is the only thing within the quotes. i.e.
>   #define foo(bar) printf("bar")
>   will expand bar within the quotes where
>   #define foo(bar) printf("the argument was bar")
>   will not expand bar.

Some folks may not understand why the approach Joe describes is a full
solution to "stringizing".  Remember that the draft standard specifies
that consecutive string constants are concatenated at compile time, so
you could say something like

	#define foo(bar) printf("the argument was " "bar")

to get the effect of substitution within a string.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list