🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4039

Re: Preprocessor question

#4039
From: Norman Diamond
Date: Tue, 19 Sep 1995 05:53
18 lines
1132 bytes
In article <43js0n$1j5@icebox.mfltd.co.uk>, ked@mfltd.co.uk (Kev Digweed) writes:
>I'm trying to stringize [...] the VALUE of [...] a symbol already defined
>to the preprocessor
>    #define STR(wibble) #wibble
>    #define X 1
>    #define STRX STR(X)
>Of course, when I use STRX, I get "X". However, I want "1".

     #define STR(wibble) #wibble
     #define X 1
     #define STRY(a) STR(a)
     #define STRX STRY(X)

--
 <<  If this were the company's opinion, I would not be allowed to post it.  >>
"I paid money for this car, I pay taxes for vehicle registration and a driver's
license, so I can drive in any lane I want, and no innocent victim gets to call
the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
Technical Details
Message-ID: <43lltn$qbh@usenet.pa.dec.com>
Path: arc1-ca.pugleaf.net!jrd.dec.com!diamond
References: <43js0n$1j5@icebox.mfltd.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!jrd.dec.com!diamond
From: diamond@jrd.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: Preprocessor question
Date: 19 Sep 1995 05:53:59 GMT
Organization: DEC Japan Research and Development Center
Distribution: world
Message-ID: <43lltn$qbh@usenet.pa.dec.com>
References: <43js0n$1j5@icebox.mfltd.co.uk>
NNTP-Posting-Host: jit533.jrd.dec.com