class Rec { // definition of a record public: int ID; double GPA; short salary; char major[4]; char stuff; }; void main() { int reclength = 48; // reading in the data int id = 111223333; double gpa = 2.345; short salary = 2222; char major[4] = {'C','S','E','D'}; char *stuff = "John Doe:1002 Anywhere Street"; ofstream myFile("data4.bin", ios::out | ios::binary ); char *dum = new char[reclength]; // defining the char array Rec* myrecord = (Rec *)dum; // pointing to the beginning of the char array myrecord->ID = id; // building the array myrecord->GPA = gpa; myrecord->salary = salary; strcpy(myrecord->major,major); memcpy(&(myrecord->stuff), stuff,reclength-18); cout<ID<GPA<salary<major[i]; cout<stuff)<<"\n"; cout<