• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Preprocessor concatenation questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Preprocessor concatenation questions
      • From: leenoori <email@hidden>
References: 
 >Preprocessor concatenation questions (From: leenoori <email@hidden>)
 >Re: Preprocessor concatenation questions (From: Michel Schinz <email@hidden>)
 >Re: Preprocessor concatenation questions (From: leenoori <email@hidden>)

  • Prev by Date: Unit testing a plug-in architecture
  • Next by Date: Re: Unit testing a plug-in architecture
  • Previous by thread: Re: Preprocessor concatenation questions
  • Next by thread: Re: Preprocessor concatenation questions
  • Index(es):
    • Date
    • Thread