The code below works on VS but fails on gcc. Any idea?
#include <stdio.h> #include <stdlib.h> #include <string.h> #define STRINGIT(a) #a #define FULL_PATH(d,f) STRINGIT(d##/##f) int main() { char buf[1024]; strcpy(buf, FULL_PATH(c:/root, config)); printf("should be: c:/root/config. found: %s\n", buf); } Compilation and errors (on eclipse with CDT): gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"test.d" -MT"test.d" -o"test.o" "../test.c" ./test.c:12:1: error: pasting "root" and "/" does not give a valid preprocessing token ./test.c:12:1: error: pasting "/" and "config" does not give a valid preprocessing token -- Regards. David Harel, ================================== Home office +972 77 7657645 Fax: +972 77 7657645 Cellular: +972 54 4534502 Snail Mail: Amuka D.N Merom Hagalil 13802 Israel Email: [EMAIL PROTECTED] ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]