Code:
#include <iostream>
#include <math.h>
#include <vector>
using namespace std;
int main (void) {
int sv = 0, fv = 0;
cout << "Start Value:" << endl;
cin >> sv;
cout << "End Value:" << endl;
cin >> fv;
cout << endl;
int size = (int)sqrt(fv-sv)+5;
[B]vector <vector<int> > grid [size][size];
vector <vector<int> > grid2 [15][15];[/B]
int midx = (int)(sqrt(fv-sv)+5/2)-1, midy = (int)(sqrt(fv-sv)+5/2)-1;
int down = 0, right = 0, left = 0, up = 0;
int yy = 0, xx = 0;
int count = 0;
string dir = "down";
for (int i = 0; i <= 5 ; i++) {
if (dir=="down") {
for (int i2 = 0; i2 < 1 ; i2++) {
[B]grid2[1][1] = 5;
grid[0][0] = 5;
grid [midx][midy] = i;[/B]
}
dir = "right";
}
}
}
31 C:\Documents and Settings\Admini strator\Desktop \Testing Files Folder\J42001.c pp no match for 'operator=' in 'grid2[1][1] = 5'
note C:\Dev-Cpp\include\c++ \3.4.2\bits\vec tor.tcc:131 candidates are: std::vector<_Tp , _Alloc>& std::vector<_Tp , _Alloc>::operat or=(const std::vector<_Tp , _Alloc>&) [with _Tp = std::vector<int , std::allocator< int> >, _Alloc = std::allocator< std::vector<int , std::allocator< int> > >]
32 C:\Documents and Settings\Admini strator\Desktop \Testing Files Folder\J42001.c pp no match for 'operator=' in 'grid[0][0] = 5'
Comment