Home > Back-end >  Brothers and sisters to help me take a look at this code right ah, why do I clearly the new document
Brothers and sisters to help me take a look at this code right ah, why do I clearly the new document

Time:05-26

Thank you
# include
# include
Void main ()
{
The FILE * fp.
Char ch, filename [20];
Printf (" do input the filename you want to write: ");
The scanf (" % s ", filename);
if( ! Wt (fp==fopen (filename, "+")));
{
Printf (" always open the file! \n");
The exit (0);
}
Printf (" do input the sentences you want to write: ");
Ch=getchar ();
Ch=getchar ();
While (ch!=(EOF)
{
Fputc (ch, fp);
Ch=getchar ();
}
The fclose (fp);
}

CodePudding user response:

 # include 
# include

//void main ()
Int main ()
{
The FILE * fp.
Char filename [20].
int ch;//is defined as an int, such ability compared with EOF
Printf (" do input the filename you want to write: ");
The scanf (" % s ", filename);
//if (! Wt (fp==fopen (filename, "+")));//why a semicolon, why use==
if(! Wt (fp=fopen (filename, "+")))
{
Printf (" always open the file! \n");
The exit (0);
}
Printf (" do input the sentences you want to write: ");
Ch=getchar ();
Ch=getchar ();
While (ch!=(EOF)
{
Fputc (ch, fp);
Ch=getchar ();
}
The fclose (fp);

return 0;
}

For your reference ~

CodePudding user response:

The
reference 1/f, confident boy reply:
 # include 
# include

//void main ()
Int main ()
{
The FILE * fp.
Char filename [20].
int ch;//is defined as an int, such ability compared with EOF
Printf (" do input the filename you want to write: ");
The scanf (" % s ", filename);
//if (! Wt (fp==fopen (filename, "+")));//why a semicolon, why use==
if(! Wt (fp=fopen (filename, "+")))
{
Printf (" always open the file! \n");
The exit (0);
}
Printf (" do input the sentences you want to write: ");
Ch=getchar ();
Ch=getchar ();
While (ch!=(EOF)
{
Fputc (ch, fp);
Ch=getchar ();
}
The fclose (fp);

return 0;
}

For reference ~

谢谢~~

CodePudding user response:

I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html

CodePudding user response:

reference it_xiangqiang reply: 3/f
hope helpful to you: https://blog.csdn.net/it_xiangqiang/category_10581430.html
I hope it can help you: https://blog.csdn.net/it_xiangqiang/category_10768339.html

Thank you  big website templates do not really
  • Related