I notice two specific issues with your program, but I'm not sure either of them is the main problem you're having. You don't describe what's not working, so it's hard to figure out what you specifically want fixed.
First, your while(file) loop outputs st.roll even if the read failed. This will result in the last number being output twice.
Second, you forgot to serialize the data before writing it. When you read from or write to a file, you need to specify the precise bytes you want write out and process the precise bytes you read in. Simply casting a 'student' to a 'char *' doesn't cut it.
For example, suppose you compile this on a computer that has four-byte integers and I compile it on a computer that has two-byte integers. One of us is not writing files in the correct format, and there's no way to know which of us. (Same argument goes for a big-endian versus a small-endian computer.)
You need to make a file format specification that specifies what bytes go where. (For example, if an integer is four bytes, do you write a 1 as 00-00-00-01 or 01-00-00-00?) Then you need to serialize your structure into that format.
Casting to write data to a file or socket is a *very* bad habit.