R
Richard Hayden
Hi,
Why does gcc (3.3.2) give me a 'initialization from incompatible pointer
type' warning when compiling:
int main(int argc, char** argv) {
int testa[2][2];
int** testp = testa;
}
Whereas the following code works without warnings:
int main(int argc, char** argv) {
int testa[2];
int* testp = testa;
}
I thought that multi-dimensional arrays were implemented as arrays of
pointers to arrays of pointers?
Any insight gratefully appreciated!
Thanks,
Richard Hayden.
Why does gcc (3.3.2) give me a 'initialization from incompatible pointer
type' warning when compiling:
int main(int argc, char** argv) {
int testa[2][2];
int** testp = testa;
}
Whereas the following code works without warnings:
int main(int argc, char** argv) {
int testa[2];
int* testp = testa;
}
I thought that multi-dimensional arrays were implemented as arrays of
pointers to arrays of pointers?
Any insight gratefully appreciated!
Thanks,
Richard Hayden.