# include
# include
The main ()
{
The FILE * fp.
Char STR [50], filename [50];
Printf (" string ");
Gets (STR);
Printf (" file: ");
The scanf (" % s ", filename);
If ((fp=fopen (filename, "w")!=NULL))
{
The fputs (STR, fp);
The fclose (fp);
}
}
1> W: \ C code \ Project1 \ source. 40 (12) C: warning C4047: "=", "FILE" * "and" int "indirect level of different
1> W: \ C code \ Project1 \ source. C (11) : warning C4996: 'the scanf' : This function or variable may be unsafe. Consider using scanf_s home. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See the online help for details.
1> W: \ C code \ Project1 \ source. (12, 14) C: warning C4996: 'fopen' : This function or variable may be unsafe. Consider using fopen_s home. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See the online help for details.
1> Project1. Vcxproj - & gt; W: \ C code \ Project1 \ Debug \ Project1 exe
1> Generating project has been completed "Project1. Vcxproj" operation,
==========: one success and failure zero, zero, latest skip 0==========
String: hapy, happy
File: happy. TXT
W: \ C code \ Project1 \ Debug \ Project1 exe process (10044) have withdrawn, code - 1073741819,
Press any key to close this window...
Don't know is what reason, also won't change it for
CodePudding user response:
if ((fp=fopen (filename, "w")!=NULL))
To the following:
if ((fp=fopen (filename, "w"))!=NULL)
Note the position of the brackets,
Because! Higher priority==
CodePudding user response:
Thank you very much! Every back to help me solve the problem! I don't know how to thank you!CodePudding user response:
What a shame was the same question twice ~! ~ ~!CodePudding user response:
Why there has been nothing TXT fileCodePudding user response:
The