This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Token Pasting operator


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]