Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!decwrl!pyramid!pesnta!wjvax!brett From: brett@wjvax.UUCP Newsgroups: net.unix-wizards Subject: 4.2 BSD Preprocessor Query (result) Message-ID: <689@wjvax.wjvax.UUCP> Date: Wed, 23-Apr-86 11:58:38 EST Article-I.D.: wjvax.689 Posted: Wed Apr 23 11:58:38 1986 Date-Received: Sat, 26-Apr-86 05:09:57 EST Reply-To: brett@wjvax.UUCP (Brett Galloway) Organization: Watkins-Johnson Co., San Jose, Calif. Lines: 19 Keywords: 4.2, BSD, cpp > 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. The concensus seems to be that the C preprocessor cannot be made to substitute for macros within quotes. Period. Thank you to those who responded. It is rather disappointing that cpp can't be made to substitute in this case. Oh well ... at least I know that I have to find a work-around. ------------- Brett Galloway {pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett