zl程序教程

您现在的位置是:首页 >  后端

当前栏目

C语言之数组为参数传递表示指针(三十七)

C语言数组 指针 表示 参数传递 三十七
2023-09-14 09:09:58 时间
#include <stdio.h>
int test_size(int data[]){
	printf("sizeof(data) = %ld\n",sizeof(data)); //sizeof(data) = 8
}
//注意:凡是指针类型都是占8个字节,不论32位,还是64位系统,都是如此

int main(){
	int count[] = {1, 2, 3, 4, 5};
	printf("sizeof(count) = %ld\n", sizeof(count));//sizoef(count) = 20

	test_size(count);

	return 0;
}