im currently studying how to manipulate files using seekp, seekg, etc, and i am attempting to use the command fstream.write. heres the snippet of code i've currently got:
and heres what i get in the data.dat file:Code:.... fstream fileObject("data.dat",ios::out); .... cout << "enter id: "; cin >> temp->ID; cout << "enter name: "; cin >> temp->name; cout << "enter birthdate: "; cin >> temp->birthdate; cout << "enter position: "; cin >> temp->position; fileObject.write(reinterpret_cast<const char *>(temp),sizeof(temp));
i have a feeling its got something to do with the reinterpret_cast<const char*> bit, and i was hoping someone could please give me any insight into this peculiar problem. thanks a lot in advance! (borland 5.02)Code: