RE: String concatenation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



use the following at the beginning:
#include <stdio.h>
You'll get a warning, but ignore it.
Robert

-----Original Message-----
From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx]On
Behalf Of Srivatsan S
Sent: Wednesday, July 30, 2003 2:12 AM
To: gcc-help@xxxxxxxxxxx
Subject: String concatenation


Hi,

I have the following piece of code which compiles properly with gcc version
2.95.3, but gives warnings in 3.2.3. This code piece uses token pasting
operator in C (##) for string concatenation.


#define SETVALUE(x,y)  x##y

main()
{
    char z[20];
    sprintf(z, "%s", SETVALUE("test ", " the program" ));
    printf("z=%s \n", z );
}

How to compile this successfully on 3.2.3 without warnings?

Thanks,
Srivatsan



____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux