Quote Originally Posted by s123456 View Post
You said to put the read statement inside the loop ...it didn't work...so I need help making it work
But I never said that you should pass in the return value of read(...) to cout!
Code:
	for(int i = 0; i< 4;i++)
	{	
		file.read(reinterpret_cast<char*>(&yourCat), sizeof(struct Cat));
		cout << setw(10) << left << yourCat.name << "\t";
		cout << yourCat.age <<endl;
	}
Besides, you must open this file for reading before trying to read anything!