In my case, the code I want looks something like this:
anRow0[] = {0,0,0,0,0,0,0} anRow1[] = {0,0,0,0,0,0,0} anRow2[] = {0,0,0,0,0,0,0} int place(int nVar1, int nVar2) //Where nVar1 is the row and nVar2 = current turn { int nVert = 0; while (anRow\i want to add nVar1 here\[nVert+1] && nVert < 6) { nVert += 1; } anRow[nVert] = nVar2; return true; } I could make several "if (nVar1 == 0) //check for anRow1[] etc. but that seems inefficient.
Is there a way to add a number like this? Also, please ignore the rest of code, I know you could for example replace the while with a for, but that's besides the point.
Appreciate any help
anRow\i want to add nVar1 here\[nVert+1]?array[x,y]you were looking at a different language, in C++ it'sarray[x][y]