fileOps.cpp
/*
* Function to write in a binary file.
*/
Function to write in a binary file.
Function to write in a binary file .
void write_record()
{
	ofstream outFile;	
	outFile.open("student.dat", ios::binary | ios::app);
	Student obj;
	obj.setData();	
	outFile.write((char*)&obj, sizeof(obj));
	outFile.close();
}
void write_record ( ) { ofstream outFile ; outFile . open ( " " , ios :: binary | ios :: app ) ; Student obj ; obj . setData ( ) ; outFile . write ( ( char * ) & obj , sizeof ( obj ) ) ; outFile . close ( ) ; }
Function to write in a binary file.
Function to write in a binary file .
// output file stream, declared
 // open with binary mode and append to file.
 // get input data
 // write(const char* s, streamsize n)
 // s: pointer to an array of atleast n characters
 // n: number of char's to insert
 // therefore pointer of the address of obj
