hey there. my problem is pretty simple (i think). I dont know how to point at a multi dimensional array.how i understand normal array pointers is:
int numbers[5];
int *p = numbers;
//so now *p points to numbers[0]
//so if you say:
*p = 10;
//is the same as saying numbers[0] = 10;
//now by saying:
p++;
*p = 20;
//you are basically saying numbers[1] = 20;
right. thats fine. in my mind thats how it works and it makes me happy. like I said, im a newb. So if i totally misunderstand the workings of pointers please enlighten me. BUT now if i say:
int numbers[4][2];
int *p = numbers;
i get an error that tells me:
"cannot convert `std::string (*)[2]' to `std::string*' in initialization "
so what must i do???
the reason why i want to point to multi-dimensional arrays is basically because i have a [4][4] grid of type string that displays tiles in a 10x10 grid on-screen, like so:
####
#### y
####
####
x
I want to add another type of char to a specific coordinate on THAT SPECIFIC grid, using a function, which is why I am using pointers.
####
#### y
##@#
####
x
but i get an error message :(. hope that explanation helps
thanks