【文件属性】:
文件名称:用数组名指针常量引用数组元素-C语言学习资料
文件大小:633KB
文件格式:PPT
更新时间:2021-04-25 17:49:09
C语言
用数组名(指针常量)
引用数组元素
main()
{int a[10],i;
puts(“please input %d score:”,N);
for (i=0; i<10; i++)
scanf("%d", &a[i]);
for (i=0; i<10; i++)
printf("%d ", a[i]);
}
6000
6001
6002
6003
6004
6005
6006
6007
a
a+1
a+2
输入输出数组元素:方法1:数组名+下标
main()
{int a[10] ,i;
puts(“please input %d score:”,10);
for (i=0; i<10; i++)
scanf(“%d”, ? );
for (i=0; i<10; i++)
printf("%d ", ? );
}
输入输出数组元素:
方法2:数组名+偏移量
a+i
*(a+i)
a[0]
a[1]
a[2]
a[3]
测控下次开始