I don't know how to define a macro string with variable, like this:
#define str(x) "file x.txt", that mean I desire that str(1) refers to "file 1.txt".
However, in the case, str(1) or any number refers to "file x.txt", because x is an character.
Is there any way to solve this?
int foo=5; STR(foo)you're still talking aboutfile foo.txt, notfile 5.txt. Macro's work at compile time, before variables have values assigned.