Hi,
I really need some help. I need to write a structure to disk in c++ builder. I have been trying now for a couple of weeks and I am now about to give up. I have tried fread,fwrite etc. fstream as well as TFileStream with no luck.
I have now tried a simple program to write a structure containing :
struct s
{
int a;
String name;
};
<< moderator edit: added [code][/code] tags >>
I write this to disk and then try reading it back and I just get garbage if i read the two variables. If i close the program, reopen then try load straight away I can get the two variables back ok but then get an access violation. This is using fstream. fread and TFileStream just cause garbage and access violoations all the time.
I am using c++ bUilder 6.
Any ideas how I can save this structure to disk? Can someone give me some source code?
regards
Nathan