Can anyone explain how the following three methods of declaring a pointer are different?
c array variable-declaration pointer
For example,
int* arr1[8]; // array containing 8 int* type elements
int temp = 3; // Integer
Assign an integer address to an element of arr1[0] = &tempint; //arr1
int (*arr2)[8]; // pointer to an int-type array with 8 elements
inttempArr[8]; // int-type array with 8 elements
Assign the address of tempArr to arr2 = &tempArr; //arr2
To learn more about this rule, see operator precedence
© 2024 OneMinuteCode. All rights reserved.