- #include <stdio.h>
- #include <conio.h>
- int main()
- {
- int n[10];
- int i;
- for(i=0; i<10; i++)
- {
- n[i]=i+1;
- }
- int *pn = n;
- printf("n[2]=%d\\n", n[2]);
- printf("n[2]=%d\\n", *(pn+2));
- printf("n[2]=%d\\n", *(n+2));
- printf("n[2]=%d", pn[2]);
- return 0;
- }
- //该片段来自于http://www.codesnippet.cn/detail/2805201512692.html
来源: http://www.codesnippet.cn/detail/2805201512692.html