Return Value
The total number of elements successfully written is returned as a size_t object, which is an integral data type.
If this number differs from the count parameter, it indicates an error.
fwrite(Head , sizeof(Student) , 1 , dat);
if(size_t != count)
std::cout<<"The systerm did not succeeded saving your request"<<endl;
std::cout<<"The system absorbed your student"<<endl; // check if the fwrite Succeed
i'm getting an error "error C2059: syntax errer: '!="
In fact yes, but I have another question...
The Visual studio created a binary file named data.dat (as I asked him to.. :) ) , can I take this file and open it in other program ?
I mean open a new project and load this "data.dat" ...?
It's just a binary text file right? Then yes, you can open it in another program. But remember that it must be read in exactly the same way.
But, it is possibly the case that such a file would be problematic on another computer, where the format in memory of your class Student might be different.