I am new to C++ and want to learn about binary files.
I am trying to write/read to a binary file using the insertion/extraction operators. I would like for the functions to be in the class itself. I am writing the data to the binary file and then choosing which object I want to read from the file. The data will be different lengths.
What you're trying to do is not exactly easy. Not for a beginner, anyway.
Google serialization, that's what it's called when you convert an in-memory data structure, such as an object, into a stream of bytes, such as a file, and viceversa.