ofstream output;
output.open( "myfile.out", ios::out );
if( !output.is_open() )
{
cerr << "Failed to open file" << endl;
return 1;
}
int example = 30
output << "This line with " << example << " should be on one line" << endl;
but in myfile.out it looks like this:
1 2
This line with 30
should be on one line
How do you get it to print like it would if just printing to standard output?