The best way is: go buy a book.
Vectors are cool, but unless you're using them as a vector, by adding, removing, and modifying, they're pointless.
do this:
Code:
double table[ROWS][COLUMNS];
How is this set up?
rows=2
collumns=3
so....
Code:
row
0 1
0 x x
col 1 x x
2 x x
3 x x
Remember, all arrays are zero-based. So a statement like this:
Code:
for( int col = 1; col < table[row].size(); col++ )
Also, why do this:
Code:
cout << "Number of Rows: " << table.size() << "\n";
cout << "Number of Columns: " << table[1].size() << "\n";
When you can replace table.size() with ROWS and the other with COLUMNS? Its more efficient.
Why does it print zeros? Because you filled it with zeros. Remember this?
Code:
vector< vector<double> > table(ROWS,
vector<double>(COLUMNS, 0.0) ) ;
That 0.0 is filling the whole collums with zeros. And no where in your code do you fill it up with somthing else.
BTW, I can't make sense of your program, it just doesn't make any sense on what you're doing. You're output routine is very wierd, printing everything bottom-right of the coordinates (x,y)the user entered...