What is the best or easiest way to save data in C++ and printing?? I.E. a checkbook balance where I want to keep a rolling track of last balance calculated instead of using a cin to enter it everytime??
Thanks!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Best way if probably through a data file. This is one of those cases in life where you can use either the C or the C++ method for file input / output. In the C++ method, you will create an object of either the ifstream class or the ofstream class, depending on whether you are doing input or output. I don't have a good example on this puter right now, let me see what I can hunt up, or someone will hop in with one of theirs.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is the best or easiest way to save data in C++ and printing?? I.E. a checkbook balance where I want to keep a rolling track of last balance calculated instead of using a cin to enter it everytime??
Thanks!!
Best way if probably through a data file. This is one of those cases in life where you can use either the C or the C++ method for file input / output. In the C++ method, you will create an object of either the ifstream class or the ofstream class, depending on whether you are doing input or output. I don't have a good example on this puter right now, let me see what I can hunt up, or someone will hop in with one of theirs.
Wayne
Herea a good link on file i/o:
http://www.ibiblio.org/obp/thinkCScpp/chap23.htm
Wayne