Re: Preprocessor concatenation questions
Re: Preprocessor concatenation questions
- Subject: Re: Preprocessor concatenation questions
- From: Michel Schinz <email@hidden>
- Date: Thu, 14 Dec 2006 15:08:12 +0100
Le 14 déc. 06 à 14:58, leenoori a écrit :
El 14/12/2006, a las 14:42, Michel Schinz escribió:
I think the following FAQ entry is what you're looking for:
http://c-faq.com/ansi/stringize.html
Thanks, Michel, but I don't want to stringify foo and bar (to "foo"
and "bar") and then mash them together (to get "foobar"); I want to
get foobar with no quotes. I can do this if I just used the
concatenation operator (##), but not if I add another level of
indirection, which is what I would like to be able to do.
Yep, but the FAQ entry says at the end "An equivalent circumlocution
is necessary with the token-pasting operator ## when the values
(rather than the names) of two macros are to be concatenated". By
"equivalent circumlocution", the following is meant:
#define foo FOO
#define bar BAR
#define MY_MACRO0(a,b) a ## b
#define MY_MACRO(a,b) MY_MACRO0(a,b)
MY_MACRO(foo,bar)
Here MY_MACRO(foo,bar) yields FOOBAR, which is what you want I think.
HTH,
Michel.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden