Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language, on the question of finding the length of the array!
C language, on the question of finding the length of the array!
A: First of all, mainly.

In the function, a is a one-dimensional array, which is the const pointer. At this time, sizeof(a) can calculate 4* 10.

=

40, sizeof(int) is 4.

Second, in int

Finally, pass the as an address to the function. This arr is just a pointer variable with a size of 4 bytes. When using sizeof(arr), you can only get 4.

This sizeof is very strange. You defined it in the main function.

tea

*b

=

“hello world”;

If you use sizeof(b), you can also calculate 4, I see, hehe.