c++ - ofStream printing in another function -
I have a strange problem running. I have two functions, both of which have been passed by reference. But when I call another function, a part of the first function is being printed.
Here's the first task:
zero gameplay :: dealDominos (offstream & outstream, int seeds) {for (int i = 0; i & lt; 10; ++ i) {Outstream & lt; & Lt; "Random" & lt; & Lt; Rand () & lt; & Lt; Endl; }} My second task is:
zero gameplay :: Find Longest Sack (offstream and outstream) {outstream & lt; & Lt; ToStringSeq (label, maxsec) & lt; & Lt; Endl; } However, my output looks like this:
New MAX [T 8] New MAX random [T 8 8] [T8 1] New maximum number [T8] [T81] [T1 1] [T2 2] New Max Dome [T8] [T8 1] [T1 1] [T2 2] [T2 11] ] For Maximum CIF: Dom [T8] [T8 1] [T1 1] [T2 2] [T2 11] Let me label the word "random" and Can be printed between the sequence ..
How do I fix this?
It seems that you have two different offsets objects in the same Referring to the underlying file, which is a very bad idea unless you are not looking for many things to write each, to ensure that the file conditions for each position are updated.
Comments
Post a Comment