Each type should be determined according to the compiler. The following is the result of the 32-bit machine standard
char str[ ]= ”Hello”;
char * p=str;
int n=10;
sizeof(str)=( 6 )
sizeofchar str[ ]= ”Hello”;/*yes Wrong, it should be repeated */
char *p=str;
int n=10;
sizeof(str)=( 6 )/ *To find the total number of bytes, not the length, compare the strlen function*/
sizeof(p)=(4)/*On a 32 machine*/
sizeof(n)=( 4 )
void func(char str[100])
{ }
sizeof(str)=( 4 )/* When an array is passed to a function as a parameter, a pointer is passed instead of an array. What is passed is the first address of the array. Haha~~, keep this in mind*/
(p)=(str)
sizeof(n)=( 4 )
void func(char str[100])
{ }
sizeof(str)=( 4 )
It feels weird, they are all the same, maybe I have lost the process of change...