因此,我有以下代码片段:
int * iPtr ;
int * jPtr ;
int i = 5, k = 7;
iPtr = &i;
jPtr = iPtr ;
我刚刚开始学习有关指针的知识,需要清除一些疑问。
最佳答案
1000 1001 1002 1004 --> address location ( note: just indicative)
----------------------------
| 5 | 7 | 1000 | 1000 |
| i | j | iPtr | jPtr |
-----------------------------
^^ | |
||________| |
|_________________|
iPtr=&i; --> iPtr points to i ==> address of i is stored in iPtr ==> *iPtr contents of i
jPtr=iPtr; ->jPtr points to i