Reputation: 151
I have a function declared as:
int func(int a, int b, ...);
Then I want to #define a function-like macro as:
#define TEST(A,B) func(A,B,0)
But the compiler always complains: "error: expected declaration specifiers or '...', before numeric constant".
So, how can I eliminate this error?
Upvotes: 1
Views: 62
Reputation: 156
Make sure the function is defined before the #define statement (could be imported too) so the compiler will the data type of a and b. Or you could also try type defining a and b as (int) a.
Upvotes: 1