Creating more than one record in binary file using a structure

I'm trying to write a program that keeps records in a binary file. When I write more than one record it only displays the last one. How do I write and display more than one record?

[code]
Last edited on
You need an array or list of student and additionally a variable for the count.

If you can use vector it is handled for you
You need to move line 60 to right after line 70. That way after you read each record, you will write it to the file.

But there is another problem: you can't write a string to a binary file because it contains a pointer to the data. You'll need to change info.name to an array or write methods to read/write the string in binary format.
Topic archived. No new replies allowed.