Hi there guys. I'm trying to output the contents of a single subscripted array with the size 100 but I am seriously struggling.
I need the table to look something as follows:
Here is the code I've been working with for a while yet have not gotten anywhere. setw() confuses me quite a bit and I don't want to use /t. Each section of the array has either a positive or negative 4 digit value. Forgive if the code if laughable.Code:0 1 ... 9 0 +0000 +0000 10 +0000 +0000 ... 90
Any help would be much appreciated!Code:for( int j = 0; j < MEMSIZE; j++ ) { static int number = 0; if( j % 10 == 0 ) { cout << endl; cout << setw( 2 ) << noshowpos << number; } cout << setw( 5 ) << showpos << setfill( '0' ) << mem[ j ] << '\t'; number += 10; } }