Hi
I am writing data from two vectors to a file in the following way:
However, is there a way to format the data output? E.g., such t hat there is 8 numbers in total, i.e. of the formCode:std::ofstream data_file("data.txt", ios::out); j = Y.begin(); for(i=X.begin(); i<X.end(); i++) { vectorFile << *i << "\t" << *j << "\n"; j++; } data_file.close();
123.45678
12.345678
1.2345678
....
I have tried with
but that didn't do any difference.Code:std::cout.setf ( std::ios_base::right, std::ios_base::basefield ); std::cout.width ( 5 );
Best,
Niles.