Error initializer element is not constant

c

I am having trouble with my code, and I can not solve ….

the code snippet where the error is reported:

static FILE *debugOut = stderr;
static FILE *infoOut = stdout;

The error that the gcc return is:

initializer element is not constant

Best Answer

try doing it in main for example:

static FILE *debugOut;
static FILE *infoOut;

main(){
    debugOut = stderr;
    infoOut = stdout;


}