Considering that macros in C are processed by the preprocessor before compiling the project, as well as what is in macros with variables, etc. work as with text, is it possible in some way to add another to one line, but in such a way that it is performed at the level of complementing the source code, and not at runtime?
Example:
#define VERSION_CODE "1.0"
#define ADD_VERSION(base) (base!" !"VERSION_CODE)
int main() {
printf(ADD_VERSION("MyProgram"));
return 0;
}
Here, the !"
symbol denotes the removal of the quote to the right of the argument and to the left of the existing line.
I would not like to perform this action at runtime, since all the constituent strings are already known.