Home > Back-end >  VS2017, C language using the fscanf () function to read file prompt the Debug an Assertion Failed!
VS2017, C language using the fscanf () function to read file prompt the Debug an Assertion Failed!

Time:04-11

C language for beginners, compile environment VS2017, today with the fscanf () function to read file prompt the Debug an Assertion Failed! Have tried many methods haven't solved, bosses, give some advice in this thanked the code is as follows:
#include
#include
Int main ()
{
int c=0;
The FILE * pfile;
Pfile=fopen (" E: \ \ C_test \ \ PRJ \ \ doc \ \ test TXT ", "r");
If (pfile=NULL)
{
Printf (" ERROR!" );
The exit (1);
}
The fscanf (pfile, "% d", & amp; C);
Printf (" content is: % d \ n ", c);
The fclose (pfile);
return 0;
}


Runtime pop-up dialog is as follows:

Ask everybody to help! Thank you thank you!!!!!!

CodePudding user response:

Line 8, should be==

CodePudding user response:

No, thank you brother! Make it wrong,,,