數組的地址

代碼

/*************************************************************

對於一個數組來說,比如int a[]
a==&a==&a[0],這三個值是相等的,代表這個數組的起始地址

*************************************************************/

#include<stdio.h>
#include<string.h>

struct 
{
	int a,b;
}ST[3];



int main(){
 
	int a[3];

	printf("a=%d \t &a=%d\n",a,&a);
	printf("&a[0]=%d \t &a[1]=%d\n",&a[0],&a[1]);

	printf("\n");
	printf("ST=%d \t &ST=%d\n",ST,&ST);
	printf("&ST[0]=%d \t &ST[1]=%d\n",&ST[0],&ST[1]);

	printf("\n");

	return 0;
}

運行結果


發佈了60 篇原創文章 · 獲贊 20 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章