Home > Back-end >  Run on Linux a segmentation fault errors, why? (this is a daffodil number of questions)
Run on Linux a segmentation fault errors, why? (this is a daffodil number of questions)

Time:09-24

 


# include

Int main ()
{
The FILE * stdout;
Fopen (" Odata. Out ", "wb");
int num;
int a,b,c;
For (num=100; Num & lt; 1000; Num++)
{
A=num/100;
B=(num % 100)/10;
C=num % 10;
If (a * a * b + a + b * b * * * c=c=c num)
Fprintf (stdout, "% d \ n", num);
}
return 0;
}

CodePudding user response:

Oh understand, has been solved, the statement is the fopen function assigned to stdout, then the problem solved, compile running normally!

CodePudding user response:

Less a fclose, fopen and fclose to match,

CodePudding user response:

Stdout is the standard output stream, can not use the fclose

CodePudding user response:

refer to the second floor u010165006 response:
less a fclose, fopen and fclose to match,
stdout is the standard output stream, can not use the fclose

CodePudding user response:

The FILE * stdout;//the stdout here is your definition of a variable

CodePudding user response:

Stdout of reserved words should not be used for a custom variable names,
  • Related