I am writing to a file in C++ using streams by using following code and output is shown following the code. Here I want to format like second column is of size 10 and values should be right aligned in same way for third column as well.
for (unsigned int dvIdx = 0; dvIdx < 3; dvIdx++)
{
dataFile << myData.TimeChanged().Format().c_str() << " " << myData.GetValue()
<< " " << myData.GetQuality() << std::endl;
}
2012-06-25 12:01:04.000 1 1083507713
2012-06-25 12:01:20.000 3 1029
2012-06-25 12:01:36.000 -empty- 2157642752
Expected output is
2012-06-25 12:01:04.000 1 1083507713
2012-06-25 12:01:20.000 3 1029
2012-06-25 12:01:36.000 -empty- 2157642752
How can I change above code to get expected output. Thanks for your help and time.
You must look for
<iomanip>,setwandsetiosflags