Home > Back-end >  C input and output, master!!!!!!!!!!!!!!!
C input and output, master!!!!!!!!!!!!!!!

Time:10-07

# include "stdio.h"
# include "stdlib. H"
# include "cmath
"Void main ()
{
Int I, j, ii, ij;
//-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Int K, Fn;
Int num.
Float dt;
Int N;
Int star;
Bool Mark;
Int Mark_int;
//============================================================
The FILE * fpa00;
Char infile [100].
Out_file char in_file [100], [100].
Printf (" please input parameter file name: \ n ");
Scanf_s (" % s ", & amp; Infile);
Fopen_s (& amp; Fpa00 infile, "r");
If (fopen_s (& amp; Fpa00 infile, "r")!=NULL)
{
Printf (" the file can not be open \ n ");
}
Fopen_s (& amp; Fpa00 infile, "r");
Fscanf_s (fpa00, "% s \ n", & amp; In_file);
Fscanf_s (fpa00, "% s \ n", & amp; Out_file);
for(i=0; i<100; I++)
{
Fn=(int) pow (2.0, (double) I);
If (AA<=Fn)
{
K=I;
break;
}
}
Printf (" Fn=% d K=% d \ n ", Fn, K);
Fscanf_s (fpa00, "% d \ n", & amp; Num);
Fscanf_s (fpa00, % f \ "n", & amp; Dt);

Fscanf_s (fpa00, "% d \ n", & amp; N);
Fscanf_s (fpa00, "% d \ n", & amp; Star);
Fscanf_s (fpa00, "% d \ n", & amp; Mark_int);

The fclose (fpa00);
}
Run the total error, as shown in the figure below

Infile in my Desktop window is the input file name, in the debug errors, seeks the best solutions, asked a lot of people don't

CodePudding user response:

Fopen_s call once is ok, don't call repeat many times to open the file,

CodePudding user response:

Seems to be same as above...
  • Related