int (*p) [4] ;
Is "p" pointer to array of 4 integers ?? or what ??
and How can I call "new" for this pointer ??
The int *(a[3]) is the same as plain int *a[3] . The braces are redundant. It is an array of 3 pointers to int and you said you know what it means. The int (*a)[3] is a pointer to an array of 3 int (i.e. a pointer to int[3] type). The braces in this case are important.
int (*ptr)[10] - pointer to an array of integers. int* ptr[10] - an array of int pointers. Array of pointers. pointer may be arrayed like any data type. To assign the address of an integer variable called var to third element of the pointer array, write.
int (*p)(): Here “p” is a function pointer which can store the address of a function taking no arguments and returning an integer. *p is the function and 'p' is a pointer.
For int (*p)[3]: Here “p” is the variable name of the pointer which can point to an array of three integers.
Is "p" pointer to array of 4 integers?
Correct!
How can I call "new" for this pointer?
For example, p = new int[7][4]
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With