#include using namespace std; void filePrintIntFormatted( ofstream &fout, int intVal ) { char tmp[ 100 ]; sprintf( tmp, "%10i", intVal ); fout << tmp; } void filePrintDoubleFormatted( ofstream &fout, double doubleVal ) { char tmp[ 100 ]; sprintf( tmp, "%10.2f", doubleVal ); fout << tmp; } void filePrintStringFormatted( ofstream &fout, const string &stringVal ) { char tmp[ 100 ]; sprintf( tmp, "%10s", stringVal.c_str() ); fout << tmp; }