okey when i tried to read this struct, i get garbage on the id part... why?Code:typedef struct _INFO { char *id; int height, width; }INFO; void Save() { INFO info; char id[] = "hello"; info.id = new char[sizeof(id)]; // filling the structure strcpy(map.id, id); info.width = 640; info.height = 480; // saving routine ofstream saveinfo; saveinfo.open("info.dat", ios::binary); saveinfo.write((const char *)&info, sizeof(info));
thanks,