Difference between pointer to pointer and pointer to array?

前端 未结 3 999
一整个雨季
一整个雨季 2020-12-05 15:18

Given that the name of an array is actually a pointer to the first element of an array, the following code:

#include 

int main(void)
{
    in         


        
3条回答
  •  执念已碎
    2020-12-05 16:08

    For many operations, a implies &a and both return the same thing: The address of the first item in the array.

    You cannot get the address of the pointer because the variable does not store the pointer. a is not a pointer, even though it behaves like one in some cases.

提交回复
热议问题