I'm wanting to use setw() but for the length of the gap I want it to be the length of the number of characters + 1
so if someones name was 50 characters long it will set that gap at 50 characters long + 1. for in between the "##" and "||"
but there will be a lot of names in the file so the character counter will need to find the name with the most characters in it and count them all.
did I explain my question good enough?
thanks guys.
1 2 3 4 5 6 7 8 9 10 11 12
# include <iostream>
usingnamespace std;
int main()
{
cout << "## Full Name || Age || Phone || Customer || Member || Started || Last || Date || Date Last ##" << endl //want it to look like this
<< "## || || Number || Number || || Weight || Weight || Created || modified ##" << endl;
system("PAUSE");
return 0;
}
In file ? If I do it in my way, I'll make ad 2D array of string like array[][] where array[][0] is name array[][1] is age etc
After that i can compare the name. Snce array is static you can use std::vector
There wouldn't be much point to formatting the data just for putting it on the file.
If the formatting is for data coming off the file then you would have to size the elements first, ie run through the file twice. To avoid that, you format it as it goes on which means you the field size already.