🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4018

Preprocessor question

#4018
From: Kev Digweed
Date: Mon, 18 Sep 1995 13:25
25 lines
1037 bytes
Hi all. 

I'm trying to stringize a symbol already defined to the preprocessor (or rather
I'm trying to stringize the VALUE of that symbol).

ie, I have :

#define STR(wibble) #wibble

#define X 1
#define STRX STR(X)

Of course, when I use STRX, I get "X". However, I want "1". Is there any
portable way of doing this ? (it doesn't have to be based on the above, or
even use the stringize operator, as long as it's portable (hell, send me non-
portable solutions if there are any, it might give me an idea)).

TIA,
Kev.
-- 

Kevin.			 Micro Focus, Newbury, UK.    (ked@mfltd.co.uk)
These views are strictly my own.
I doubt very much that anyone else would want them.
Technical Details
Message-ID: <43js0n$1j5@icebox.mfltd.co.uk>
Path: arc1-ca.pugleaf.net!lade.news.pipex.net!pipex!mfmail!not-for-mail

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!lade.news.pipex.net!pipex!mfmail!not-for-mail
From: ked@mfltd.co.uk (Kev Digweed)
Newsgroups: comp.std.c
Subject: Preprocessor question
Date: 18 Sep 1995 14:25:43 +0100
Organization: Micro Focus Ltd., Newbury, Berkshire, UK.
Distribution: world
Message-ID: <43js0n$1j5@icebox.mfltd.co.uk>
NNTP-Posting-Host: icebox.mfltd.co.uk