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?
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?
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.