Re: Opening a file in binary
The first argument is where you will store the data being read. 0 means a NULL poi nter, which seems wrong.
Originally posted by niudago
Also, always check if the open methods fails or not.
typedef struct RECORDS *whatever*
const int NrOfRecords = 12;
InFile.open("Filename.sav", ios::in | ios::binary);
InFile.read((char*)MyRecords, sizeof(RECORDS) * NrOfRecords);