Created a file in the project folder. I run the following code:
FILE * f; char ch; f = (FILE *) fopen("results.txt", "r"); ch = getc(f); printf("%s", ch); fclose(f); The program crashes with the error:
"0xC0000005: access violation when reading at 0x00000074."
Although if you open the file for recording, everything is recorded normally. I tried to run the program as an administrator - the error does not disappear.
Tell me, please, what's the matter?
mainpossible andreturn EX_DATAERR;Why not -1, but EX_DATAERR? Because it is an error in the data transmitted by the user. Seesysexits.hfor thesysexits.hprogram return codes (generally accepted at least in * nix), seesysexits.h. - avpexitfunction (along with fopen, printf and a huge number of others) is usually found inlibc, which in almost all operating systems is shared (.so or .dll) and its code is not included directly in the boot module. The only instance loaded into memory is used by all programs that are currently running. Of course, a few bytes of the "adapter" linker will add, but I do not think that this is critical. - avp