How to read a specified amount bytes from a binary-file with a offset (C++)
-
And also by binary-file I mean the files with the weird characters and all. Next, Here is a example of what it should look like:
read_4_bytes("file", 0); // filename, offset and end.
Not much else to say...
-
And also by binary-file I mean the files with the weird characters and all. Next, Here is a example of what it should look like:
read_4_bytes("file", 0); // filename, offset and end.
Not much else to say...
1. Use fopen function to open the file 2. Use fseek function to go to specific offset 3. Use fread function to read the 4 bytes 4. Use fclose function to close the file
Mircea
-
1. Use fopen function to open the file 2. Use fseek function to go to specific offset 3. Use fread function to read the 4 bytes 4. Use fclose function to close the file
Mircea
One more detail - on Windows, you must open the file in "binary" mode using the O_BINARY flag (for open) or "rb" (for fopen).
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.