Skip to main content
gamedev.net
🔒 Locked

Update header

Started by Austrian Coder Jun 3, 2003 at 5:10 AM 2 replies 300+ views
Original Post
Austrian Coder
Austrian Coder
Hi! I have here an file with a header like this: struct MyHeader { unsigned int a; unsigned int b; char* c; }; Then i have a file with the header and it follows a 57 MB big data chunk. How can i change now the value b in MyHeader, without write the whole file. I am using fopen, fclose,... functions to handle files. Thanks, Christian
Jan Wassenberg
Jan Wassenberg
RTFM. fopen and fseek.
E8 17 00 42 CE DC D2 DC E4 EA C4 40 CA DA C2 D8 CC 40 CA D0 E8 40E0 CA CA 96 5B B0 16 50 D7 D4 02 B2 02 86 E2 CD 21 58 48 79 F2 C3
Leadorn
Leadorn
quote:
Original post by Jan Wassenberg
RTFM. fopen and fseek.



I know what he mean “read the fucking manual”.

1 Open file read header 2 fseek beginning 3 write header. Done

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.