I\'m somewhat new to programming, so I\'m not sure how to search for this problem, and I know I asked 2 other questions about this, but I can\'t seem to make it work.
I
This line
LoadFile.seekg(0, ios::end);
puts the file at the end of the file. You need to put it back at the start by
LoadFile.seekg(0, ios::beg);
Update
You can make the code simpler by saving the number of Device
s at the top of the file. Then, you can use:
int numberOfDevices = 0;
LoadFile.read(&numberOfDevies, sizeof(int));
for (int i = 0; i < numberOfDevices; i++)
There won't be any need to get the size of the file to deduce the number of Device
s.
The other alternative is the one suggested by @phyrrus9 where you keep reading the Device
s until there are no more Device
s to read from the file.