Reading from binary file

12/15/2015 18:06 Dwarfche#1
I would like to put into my array of type structure information from a binary file.

My code:
Code:
file_.open("D:/ТУРИСТ.dat",ios::binary | ios::in);
file_.seekg(0l,ios::end);
		pos=file_.tellg();
nused=pos/sizeof(danni);

for (int z(0);z<nused;z++)
	{file_.read((char*)&masiv[z],sizeof(masiv[z]));}
masiv is the array i created, its from type: structure
and i'd like to fill it with all the info from the ТУРИСТ file

Suggestions why its not working?
12/19/2015 15:58 hazejp#2
Seems that the file pointer remains in end position, you probably forgot seekg()-ing back to ios::beg.