+ 3
Need clarity on " v##a##r "execution?
#include <stdio.h> #include <stdlib.h> #include <string.h> #define macro(r,a,v) v##a##r #define DECVAR macro(r,a,v) int main() { int DECVAR=42; var++; printf("%d",var); return 0; } ans=43
2 Respuestas
+ 9
Have you tried checking the comment section of this feed post? In preprocessor commands, ## is concatenation. DECVAR is replaced with macro(r,a,v), which is then replaced with var. 42 is assigned to var, bar is incremented, and then printed.
https://www.sololearn.com/post/39626/?ref=app
+ 1
Thanks sir.