This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Token Pasting operator
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: vatsan007 at lycos dot com
- Cc: gcc at gnu dot org
- Date: 30 Jul 2003 03:11:14 -0300
- Subject: Re: Token Pasting operator
- Organization: GCC Team, Red Hat
- References: <BDFPEPNHLGLIBCAA@mailcity.com>
On Jul 30, 2003, "Srivatsan S" <vatsan007@lycos.com> wrote:
> #define SETVALUE(x,y) x##y
> sprintf(z, "%s", SETVALUE("test ", " the program" ));
You don't want token pasting. You want string concatenation, that
happens by simply having two strings one after another. Take out ##
from the macro and it should work.
Note that this question is inappropriate for this forum, that is
devoted to the development *of* GCC, not *with* GCC. Use
gcc-help@gcc.gnu.org instead, and make sure you read the documentation
and search for the answer to your question on the web before posting
it.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer