Well...I just set up a record keeper for my craps program, now I need to learn how to append to it so I can have a list of scores. Anyways, since it is required to have everything that happens logged, I'm sorta stuck. The only way I know how to write to a file is directly.
outfilename << variable << "or direct text.
But do to an interesting event today in 3rd block, we can't just double every cout line with a outfile line. Any suggestions or hints?
this way is a little more stable and you don't have to write the whole file every time you write any data.
P.S. remember to chack the length so you don't overflow any buffers and crash your program, or corrupt the save file.
I know how to write to the file...I've already done it. (And I don't need to use binary...cause all I'm outputting is basic text...but thanks anyway).
What I need to know is how to log my ENTIRE program, anything that goes into/comes out of the program has to be logged. but I'm not about to do:
Do you get what I'm saying?
Like...using programs like FTP pro...or installation programs...they make a log file containing EVERYTHING that happened, every action that took place. I'm not going to double up on code cause that will cause hanosh to jump all over me.
There has to be a way to do that without doubling up on code...isn't there a way? Please tell me there's a way.
Quote: from malkiri on 9:37 pm on Oct. 12, 2001
What you might consider doing is making a new class, and overload the << operator. Inside the operator<< function, you would both output to cout and to the file.
Well that would work except classes are too advanced for them right now.