Now, before you think I'm completely off my rocker, my instructor posted the UML of this method as:
+showInfix(ostream&=cout) const: void
And specifies that the program is to read data from a file, and write the results to a second file. So..I have declared ofstream fout; and passed fout to showInfix:
myExpression.showInfix(fout);
While the program is running, I am getting output in the console, as well as in the file that is supposed to be written to. However, the data being written to the file is:
1 2 3 4 5 6 7
Infix:
Postfix:
Infix
Postfix:
...
Anyone know why the remainder of my data (in this case, ifix) isn't making it to the file?
ifix is a member variable of the myExpression object's class. The problem was that I was clearing ifix before trying to output it (recycling the same instance) due to the way the program was written. This led to it being an empty variable. I changed two lines of code, and it works...and I've been fighting with it for the past 16 hours trying to figure out what the deal was...