使用指针输出数组元素


 1 /* Note:Your choice is C IDE */
 2 #include "stdio.h"
 3 void main()
 4 {
 5   int a[10];//定义整型数组
 6   int *p,i;  //定义指针和变量
 7   puts("\nPlease input ten integer:\n");
 8   for(i=0;i<10;i++)
 9   scanf("%d",&a[i]);
10   printf("\n");
11   for(p=&a;p<(a+10);p++)
12   printf("%d\n",*p);
13 puts("\n\nPress any key to quit...");
14 getch();
15 return 0; 16 }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM