Do I declare a variable and have it read in exactly four bytes from a file then process the data then read in the Next four bytes from the file untill the number of bytes to read is < 4 and work with the bytes in hex form?
How can you tell what position the pointer is in the file?
I read the articles but they don't seem to go into that much detail about it.
Thanks
I don't really understand what you are trying to do but tellg() gives you the position of the read pointer and tellp() gives you the position of the write pointer.
"if a large set of characters is the basic character set for an implementation, a compiler vender can define char as a 16-bit byte or larger." (sic)
Just because char is 1 byte one 1 system, it doesn't mean it's 1 byte on all systems. Still, using char to represent a byte is bad in my eyes (it's my opinion. Deal with it).
Catfish wrote:
"Lol, neither is a byte guaranteed to be exactly 8 bits." (sic)
That's where you're wrong. Does anybody realize that a byte is not always 8 bits? Narrow-minded views I suppose.
Framework, The quote even say "16-bit byte". If char is 16 bits it's still a byte! Such an implementation can't have uint8_t by the way, which is perfectly fine because uint8_t, uint16_t, etc. are all optional.
Sorry, Onceler, sometimes Framework likes to start fights by twisting language.
Exactly what kind of file are we talking about. A binary file, right?
Do you have a specific format to your file? (Even if it is just a list of four-byte integers.)
What are you trying to do with the data?