Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

the identifier __VA_ARGS__ can only appear in the replacement lists of variadic macros?

$
0
0

Hi All! Please I need some help, I'm trying to get the number of arguments using NUMARGS(__VA_ARGS__):

here is the definition of the macro NUMARGS:

#define NUMARGS(...)  (sizeof((int[]){__VA_ARGS__})/sizeof(int));

but the compiler throws always this error : the identifier __VA_ARGS__ can only appear in the replacement lists of variadic macros, I don't know why. so how to resolve this problem? thanks.



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>