// gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 , msvc v143 тоже самое
//#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <errno.h>
int main ( void ) {
FILE* pFile;
int er;
pFile = fopen ( "file.txt", "w" );
er = errno;
perror ( "?" ); // ? : No error
fclose ( pFile );
pFile = fopen ( "file.txt", "r+" );
er = errno;
perror ( "?" ); // ? : Invalid argument
fclose ( pFile );
return 0;
}
// gcc (x86_64-win32-seh-rev0, Built by MinGW-W64 project) 8.1.0 , msvc v143 тоже самое
//#define _CRT_SECURE_NO_DEPRECATE
#include <stdio.h>
#include <errno.h>
int main ( void ) {
FILE* pFile;
int er;
pFile = fopen ( "file.txt", "r" );
er = errno;
perror ( "?" ); // ? : No error
fclose ( pFile );
pFile = fopen ( "file.txt", "w+" );
er = errno;
perror ( "?" ); // ? : Invalid argument
fclose ( pFile );
return 0;
}