+ 1
Of which kind are the " binary files " they are talking about?
9 odpowiedzi
+ 5
Every file is stored as bytes.
bytes are values from 0 to 255, each byte value has corresponding 8bit value.
byte | 8bit
0 | 00000000
1 | 00000001
2 | 00000010
3 | 00000011
4 | 00000100
8 | 00001000
16 | 00010000
32 | 00100000
64 | 01000000
128 | 10000000
255 | 11111111
The file byte format often contains information about what the file is, rules that tell how the files should work and the file data.
Any file can be read as bytes (computer readable), but some files can be read as text (human readable).
Files opened in binary mode are read or written in bytes (bytestring),
and files opened in text mode are read or written in text (string).
+ 3
SpaceNerd All the files are stored as bytes, but some files can also be read as text, such as program files (.py, .java, .cpp), and many other such as .html, .txt .
But not all files can be read in text mode, such as image and audio files would be quite hard to get written as readable text.
+ 2
Ok thanks I think this solved my problem
+ 1
Ok so thanks
0
Seb TheS
~ swim ~
Oh, sorry I just realized that my question was not precise enough...
In fact, I knew what were binary files... My question was more like "which type of binary file can I read/write with this method in C?" But I think I understood from your answers that -- tell me if I'm wrong -- any binary file can be read or written, is it that?
Again, that's only my fault to have been not enough precise.