码迷,mamicode.com
首页 > 编程语言 > 详细

使用指针输出数组元素

时间:2017-10-17 23:00:10      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:alt   分享   pre   code   image   printf   定义   ges   src   

 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 }

技术分享

 

使用指针输出数组元素

标签:alt   分享   pre   code   image   printf   定义   ges   src   

原文地址:http://www.cnblogs.com/kinson/p/7684197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!