Here is the code I am trying to implement.

Code:
message *temp = new message;
myFile.seekg(ch);
myFile.read((char*)&temp, sizeof(message) ;
The problem is that for some reason the third line in this code is giving me problems and not returning a message at all even though I can verify that the message I am trying to read is in the file. Please let me know if you see something wrong. Thanks.