Saving to file with BCB
I have following struct:
struct s
{
int ID;
int sizeX;
int sizeY;
};
When I want to save this struct to a file I use the following command, took from BCB-Helpfile:
fwrite(&s_Struct, sizeof(s), 1, fstream);
When I look into the file - using a hex-editor - it doesn''t match the int values.
The only way it works right now is by saving every member:
fwrite(s.ID, sizeof(int), 1, fstream);
.
.
.
and so on...
Does anybody have an idea?
Thanks!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement