Macros : error: pasting does not give a valid preprocessing token

Joined
Mar 23, 2013
Messages
1
Reaction score
0
Can someone tell me what is wrong here ?

#define LOG_MACRO(format,args...) printf(format,args)

#define TEST_MACRO(__arg1, __arg2, __format, args...) LOG_MACRO("ARG1: %s, ARG2 : %s" ## __format, ##args)

char* arg1 = "test";
char* arg2 = "test";
TEST_MACRO(arg1,arg2,"Testing Macro %s","foo");


error: pasting ""ARG1: %s, ARG2 : %s"" and ""Testing Macro %s"" does not give a valid preprocessing token
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top