4.2 BSD C preprocessor query (macros in quotes)

Brett Galloway brett at wjvax.UUCP
Tue Apr 15 03:08:04 AEST 1986


I have a program in which I have a macro defining a number.  I want the
C compiler/preprocessor to generate a string containing that number.
For example ...

#define	NUM	2
#define	NUMSTR	"NUM"

The problem is that the C preprocessor will not substitute NUM when it is
in quotes.  My question (for this example) is whether there is any way to
generate a macro with value "2" frm the macro NUM.

Please respond by mail.  I will summarize.

Thank you (in advance)

-------------
Brett Galloway
{pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett



More information about the Comp.unix.wizards mailing list