[C] pointer to array
Posted by: ISSOtm
Date: 2016-09-28 04:16:33
unsigned int numberOfGen1Glitches = 9001;
And an array like this :
unsigned int partyTime[42] = {1, 3, 3, 7};
Okay. When I ask GDB about "&partyTime", I get "unsigned int(*)[42] (stuff)".
But this does NOT work :
unsigned int(*) lelzNotWorking[42] = &partyTime;
GCC throws an error about parentheses. Placing a space before the parentheses doesn't work either.
How do I declare a variable that has type "pointer to unsigned int array" ?
How do I declare an array of pointers to arrays ? (An array of variables with the above type)
Thanks in advance !
(Note :
unsigned int array[3];
unsigned int** pArray = &array;
gives a "assignment from incompatible pointer type" when compiled with GCC, which I use.)