I could use some help in figuring out how to format the output of my program when writing to a file.
Bit of code
#include[fstream.h]
#include[iostream.h]
blah
int sum;
char inputRead;
ifstream inFile;
ofstream outFile;
if(inFile.fail())
blah
if(outFile.fail())
blah
blah
outFile << sum << endl;
What I'd like to do is to align the output to the right and fill smaller values with either a space or . So the output file would look like
....567
..8345
12456
I've tried using iomanip with stuff like
outfile.setiosflags(ios::right);
outFile << sum;
But it returns an error stating something about converting longs to something else. I don't recall the exact error. I'd appreciate any help or ideas.
TIA