What's the difference between a pointer, and a pointer variable?

前端 未结 6 1613
执笔经年
执笔经年 2021-02-04 10:50

I know this is very basic but it is little bit confusing to me.
I\'ve read:

a pointer is nothing more than an address

6条回答
  •  轮回少年
    2021-02-04 11:25

    A variable is a place to store a value. In C, whenever you use a variable in a context that needs a value, the value of the variable is retrieved, so saying "p" in that context is the same as saying "the value of variable p":

    int *q = p;  // Copy the value of variable p into the variable q.
                 // aka: copy p into q.
    

提交回复
热议问题