Does the amount of bytes during a file read vary according to the mode chosen?

2

In C, if I open a file in binary mode, read it byte-by-byte and then get the file and read in text mode, the amount of bytes will be different? If so, why?

    
asked by anonymous 30.05.2017 / 03:07

1 answer

5

In no way does the file have the amount of bytes it has, no matter how read.

What changes is that reading in text mode there is a handle to the line wrap indicator that will be interpreted according to the operating system. Nothing else differs. Obviously the translation of the text change indicator can vary from having 1 or 2 bytes and it may be that the use takes 1 character at all times, but there it is something specific, circumstantial and about characters and not byte.

    
30.05.2017 / 03:24