Answer the question
In order to leave comments, you need to log in
How does the program work?
#define A abc
#define B(arg) #arg
#define C(arg) B(arg)
#include "stdio.h"
int main()
{
printf("%s\n",B(A));//"А"
printf("%s\n",C(A));//"abc"
}
Answer the question
In order to leave comments, you need to log in
It's elementary from C syntax : in macros #arg - don't resolve arg value.
In the second case, C(A) resolves the argument A even before calling B(A).
PS Just write the tags correctly - this is C, not C ++!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question