Home > Back-end >  Pray god help kangkang
Pray god help kangkang

Time:12-05

Void mode5 ()
{
Int N=0;
Char c [7]={} '\ 0';
The FILE * fp=fopen (" C: \ \ Users \ \ 666 \ \ Desktop \ \ \ \ new folder books. TXT ", "a +");
If (fp==NULL)
{
Printf (" error ");
}
for(int i=0; i<1000; I++) {
If (STRCMP (books [I] id, c)==0) break;
N++;
}
Printf (" please enter the new login number bname author's introduction to the classification of time prices \ n ");
The scanf (" % s % s % s % s % s "% s % s, books [N + 1] id, books [N + 1). The name, the books [N + 1] a writer of books [N + 1] JianJie, books [N + 1] FengLei, books [N + 1] time
, books [N + 1] price);
Char ch []="\ n \ r";
Fwrite (ch, 2, 1, fp);
Fprintf (fp, "% s % s % s % s % s % s % s \ n", books [n + 1] id, books [n + 1). The name, the books [n + 1] a writer of books [n + 1] JianJie, books [n + 1] FengLei, books [n + 1] time, books [n + 1] price);
Printf (" load success \ n ");
fclose(fp);
}
Why would enter a load the two the same

CodePudding user response:

Books [N + 1) crossing the line.

CodePudding user response:

 if (fp==NULL) 
{
Printf (" error ");
}

This place has failed to open, will continue to perform? How to use the fp behind?

 if (fp==NULL) 
{
Printf (" error ");
return;
}
  • Related