Macro sustitution inside quotes

Guy Harris guy at auspex.auspex.com
Wed Apr 11 03:44:14 AEST 1990


>Whereas:
>
>    #define string(s)	"s"
>
>evaluates in the way you would expect.

In other words, it evaluates to the string

	"s"

i.e., a one-character string containing the letter "s"?  That's what a
reader of K&R would expect; too bad their expectations are dashed on
systems like UNIX that use the Reiser preprocessor.  (Reference: K&R I,
Appendix A "C Reference Manual", p. 207: "Text inside a string or a
character constant is not subject to replacement.")



More information about the Comp.std.c mailing list