I want to know how to declare a pointer

Asked 2 years ago, Updated 2 years ago, 137 views

Can anyone explain how the following three methods of declaring a pointer are different?

c array variable-declaration pointer

2022-09-21 16:53

1 Answers

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


2022-09-21 16:53

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.