// Inserts the first n characters of the array pointed by s into the stream.
ostream& write( constchar* s, streamsize n );
We have object 'st' that occupies sizeof(student) bytes. We pretend that there is a character array in that memory location. We write the bytes to a file.
The (char *) &st is a C-style cast syntax. C++-style syntax would be static_cast<char *>( &st )