|
-
May 14th, 2010, 09:43 AM
#1
learning binary files.
currently I only know something like:
fstream fstream_Object.open(/*opening info here*/);
and looping
"fstream_Object<<Atomic_type_to_file;" or "fstream_Object>>Atomic_type_from_file;"
to get information saved to and from a file. I'm trying to learn how to use binary input and output. I looked up .bmp specifications and learned that binary files need to have a "fileheader" a "infoHeader"and a "data block" that all work together somehow.
So the question is how dose puting the three together work?
Is the file header similar to creating a "struct" and then the info header tells you where in the data block to fill each saved struct and how many?
A simpler example than a .bmp file might be something like:
struct Elements
{
unsigned int number;
unsigned int weight;
};
Elements element[118];
and place this into a file with it's own header and such.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|