It's all working nicely now except for one detail. When I do "outfile << "\n" it doesnt move down a line like it should? Is there another way to do this?
Printable View
It's all working nicely now except for one detail. When I do "outfile << "\n" it doesnt move down a line like it should? Is there another way to do this?
could be that you have to flush the output buffer.
try
insteadCode:cout << endl;
Kurt
Do you mean outfile << endl; ?
This is the code in my main while loop:
How do I get it to end the line after printing the Set result?Code:Set a;
a.readFromFile(myfile);
outfile<<a;
Set d(a.readOperator(myfile));
Set result(d);
result.order();
outfile<<" = "<<result<<"\n";
Did you open the file in binary mode? Either open it in text mode, or you'll probably have to write a \r\n pair
This is how I did my file.
Code:ofstream outfile ("C:\\Documents and Settings\\Scott\\Desktop\\C++\\SetOutput.txt");