Code:
points[1][1] = 1;
points[1][2] = 2;
points[1][3] = 3;
points[1][4] = 4;
points[2][1] = 5;
points[2][2] = 6;
points[2][3] = 7;
points[2][4] = 8;
points[3][1] = 9;
points[3][2] = 10;
points[3][3] = 11;
points[3][4] = 12;
nextpoint[1][1] = 1;
nextpoint[1][2] = 2;
nextpoint[1][3] = 3;
nextpoint[1][4] = 4;
nextpoint[2][1] = 5;
nextpoint[2][2] = 6;
nextpoint[2][3] = 7;
nextpoint[2][4] = 8;
nextpoint[3][1] = 9;
nextpoint[3][2] = 10;
nextpoint[3][3] = 11;
nextpoint[3][4] = 12;
Arrays indices in C++ start at 0, so you must either expand your array, or change your initialization.
> int points[3][4];
This array goes from [0 thru 2][0 thru 3], so:
Code:
points[0][0] = 1;
points[0][1] = 2;
points[0][2] = 3;
points[0][3] = 4;
points[1][0] = 5;
points[1][1] = 6;
points[1][2] = 7;
points[1][3] = 8;
points[2][0] = 9;
points[2][1] = 10;
points[2][2] = 11;
points[2][3] = 12;
nextpoint[0][0] = 1;
nextpoint[0][1] = 2;
nextpoint[0][2] = 3;
nextpoint[0][3] = 4;
nextpoint[1][0] = 5;
nextpoint[1][1] = 6;
nextpoint[1][2] = 7;
nextpoint[1][3] = 8;
nextpoint[2][0] = 9;
nextpoint[2][1] = 10;
nextpoint[2][2] = 11;
nextpoint[2][3] = 12;