current position:Home>*Isn't a numerical value? Because a is the address

*Isn't a numerical value? Because a is the address

2022-02-03 01:07:49 CSDN Q & A


Refer to the answer 1:

a It's a two-dimensional array ,*a Is the address of a one-dimensional array ,**a It's worth

Refer to the answer 2:

Refer to the answer 3:


Please learn how to observe before understanding and discussing !
Refer to the following :

//char (*(*x[3])())[5];//x What kind of variable is it ?//// analysis C Language statement , The key is to figure out what this variable is ( function 、 The pointer 、 Array ),// If it's a function, all that's left is its parameters and return values ,// It's the pointer, and the rest is what he points to ,// Is an array, and the rest is to explain the type of members of the array .// analysis C Language declaration rules :// Start with the first identifier on the left , Combine according to priority .* Said is .. The pointer to ,const Read only ,volatile Indicates variable ,[] Represents an array ,() The representation is a function .////x and [3] The combination description is a size of 3 Array of , Each element of the array is a kind of pointer , This kind of pointer points to a kind of function , This kind of function has no parameters , Returns a class of pointers , This kind of pointer points to a with a size of 5 Of char Type of the array #include <stdio.h>#include <typeinfo.h>char num[5];char (*x00())[5] {    return &num;}int main() {    char (*(*x[3])())[5];// Is an array , The size is 3    char (*(*x0  )())[5];// Elements of array , It's a function pointer     char (*( x00 )())[5];// The function prototype , The parameter is empty. , The return value is a pointer     char (*  x000   )[5];// Return value     x0 = x00;    x[0] = x0;    x[1] = x0;    x[2] = x0;    printf("typeid(x).name() is %s\n",typeid(x).name());    return 0;}//typeid(x).name() is char (* (__cdecl**)(void))[5]

Refer to the answer 4:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.

Random recommended