Home > Back-end >  The humble small white online seek counsel
The humble small white online seek counsel

Time:09-27

Simple c + + to open the file operations:
#include
Int main ()
{
The FILE * p;
P=fopen_s (" F: \ \ 1. TXT ", "w");


return 0;
}
Always prompt the following error: (with vs2019)
Const char * type of real participation of "FILE" * * type parameter is not compatible with
The parameters in the function call little
"Fopen_s:" function does not accept two parameters [/b]

Really don't know where is wrong, please teach a great god,

CodePudding user response:

 
Int main ()
{
Errno_t err;
Stream FILE * and * stream2;
Err=fopen_s (& amp; Stream, "crt_fopen_s. C", "r");
If (err==0) {
Printf (" The file 'crt_fopen_s. C was The opened \ n ");
}
The else {
Printf (" The file 'crt_fopen_s. C' was not The opened \ n ");
}
}

CodePudding user response:

reference 1/f, the wise know already should good karma response:
 
Int main ()
{
Errno_t err;
Stream FILE * and * stream2;
Err=fopen_s (& amp; Stream, "crt_fopen_s. C", "r");
If (err==0) {
Printf (" The file 'crt_fopen_s. C was The opened \ n ");
}
The else {
Printf (" The file 'crt_fopen_s. C' was not The opened \ n ");
}
}
thank you requested

CodePudding user response:

Vs function has a hint of oh, knock the function name can see the parameters needed

CodePudding user response:

reference 1/f, the wise know already should good karma response:
 
Int main ()
{
Errno_t err;
Stream FILE * and * stream2;
Err=fopen_s (& amp; Stream, "crt_fopen_s. C", "r");
If (err==0) {
Printf (" The file 'crt_fopen_s. C was The opened \ n ");
}
The else {
Printf (" The file 'crt_fopen_s. C' was not The opened \ n ");
}
}
thank you requested

CodePudding user response:

Head is quite lovely

Why use this? Use fstream no

CodePudding user response:

reference aurora borealis ~ 5 floor response:
head pretty cute

Why use this? Use fstream no
book read less??
  • Related