Looney I understand your problem
I also have the answer
however, this sounds similar to an assignment given by a teacher
so I will tell you the library you should use
and then you will show me how you think it is done then I will help you fix it okay?
just look up the fstream library or a.k.a. <fstream.h>
this library controls reading and writing of files of ANY format
so look it up and show me what you got
†~ Don't take life too seriously, you'll never get out alive!