Formatting output to a file.
I am trying to format data in a flat file in a particular format. The following are the steps.
Data elements in the code.
Convert data type of type double, int and Timestamp into String defined in the data elements.
create a input file stream and write the output into the file like the following.
ofstream data_file ("data_file.dat");
data_file << symbol + "," + BestBidPrice + "," + BestBidSize << endl;
My question is how to convert double, int and Timestamp to string format efficiently and write it to the file?