a,& a,第一个元素a [0]的地址与有区别是什么? 类似地,p是一个指向一个整数的指针,但被指定为数组地址。 该指针[]会执行指针算术并根据数据类型获取值吗? 进一步指望*有什么价值?它应该是一个指针吗?指针 - 数组与指针的区别
#include<stdio.h>
int main()
{
int a[]={5,6,7,8};
int *p= a;
printf("\nThis is the address of a %u, value of &a %u ,Address of first element %u , Value pointed by a %u",a,&a,&a[0],*a);
printf("\nThis is the address at p %u , value at p %u and the value pointed by p %d",&p,p,*p);
printf("\n");
}
This is the address of a 3219815716, value of &a 3219815716 ,Address of first element 3219815716 , Value pointed by a 5
This is the address at p 3219815712 , value at p 3219815716 and the value pointed by p 5
READ C-FAQ专门部6问:6.12 [链接](HTTP:// C -faq.com/aryptr/index.html) –
http://stackoverflow.com/questions/26149426/how-can-an-address-have-multiple-values阅读这个问题的答案... – Hari