I think what you are interested in is fstream. It's a stream that writes to files or gets info from files. You use it in a similar manner to ostream (cout) or istream (cin).
Go through that, see if you get it, try out some stuff. If you have problems with a specific concept, then give us some code and we can explain it to you.