Apr 8, 2013 at 9:52pm UTC
Current output:
Unsorted Data:
1 2 3 4 5 6 7 8 9 10 11
12 13 14 15 16 17 18 19 20 21 22 23
I want it to line up nicely.
Example:
1 2 3 4 5 6 7 8 9 10 11
12 13 14 15 16 17 18 19 20 21 22
I'm using
1 2 3 4 5
for (int i=0; i<size; i++)
{
cout << setw(7) << A[i];
fout << A[i];
}
Last edited on Apr 8, 2013 at 9:53pm UTC
Apr 8, 2013 at 9:56pm UTC
What I believe is happening is it's wrapping around the text. I want it to start on a new line if it hits the end of the line in the middle of an output
Apr 8, 2013 at 11:03pm UTC
well, where a text editor decides to do word wrap is just based off the window size.
you just need to pick a spot to start a new line, say halfway.
Apr 9, 2013 at 12:31am UTC
{
cout << "\t" << A[i];
}
Apr 11, 2013 at 1:56am UTC
for(int i2 = 0;i2 < 11;i2++)
{
cout << endl;
}
// place within first loop
Apr 11, 2013 at 9:01am UTC
Um, no. That will print 11 end-lines after ever number.