C language is easy to ignore

xiaoxiao2021-03-06  17

IN = FOPEN ("Input.File", "R");

INT RES = FGETC (IN);

At this time, if IN = 0x1a, res = EOF, if it determines whether the file is ended, it will be wrong.

The correct approach is Fopen ("INPUT.FILE", "RB");

OUT = FOPEN ("Output.File", "W");

What is the consequence of writing 0x0a in the file at this time?

It is actually written 0D0A !!!

The correct approach is Fopen ("Output.File", "WB");

This error actually delayed my time, Khan A! ! !

转载请注明原文地址:https://www.9cbs.com/read-39533.html

New Post(0)