Search notes:

gcc -D

With -D, the value of a macro can be defined.

prog.c

#include <stdio.h>

#define symbol2quotedText(t) #t
#define macroValue2quotedText(t) symbol2quotedText(t)

int main() {
    printf("NUMBER = %d\n", NUMBER);
    printf("TEXT   = %s\n", macroValue2quotedText(TEXT));
    printf("QUOTED = %s\n", QUOTED);
}
Github repository about-gcc, path: /options/D_/prog.c

compile.bat

gcc -DNUMBER=42 -DTEXT="Unquoted text" -DQUOTED="\"Quoted text\"" prog.c -o prog.exe
Github repository about-gcc, path: /options/D_/compile.bat

See also

GCC options
The C# compiler option -define

Index