#include "stdio.h"
void main()
{
int *p;
int a[10]={0,1,2,3,4,5,6,7,8,9};
int k=0;
p=a;
for(int i=0;i<10;i++,p++)
{
printf("%d\n",*p);/*ʵ¼Ê½á¹ûÊä³öÁË0-9µÄÊý×Ö*/
k++;
}
printf("%d",*p+k);/*ʵ¼Ê½á¹ûÊä³ö20*/
}
Ϊʲô×îºóÊä³öµÄÊÇ20ÄØ£¿°´ÕÕÎÒ¸öÈ˵ÄÀí½âÎÒ¾õµÃÊÇ*p×îºóµÈÓÚ9£¬¶øk=10£¬¾ÍÊÇ19ÁË£¬¿ÉÎÒÆÁÄ»ÉÏ´ò³öÀ´È´ÊÇ20£¬ÕâÊÇΪʲôÄØ£¿
Ã÷ÏÔ×îºópÖ¸ÏòÁËδ֪µØ·½
C/C++ code:
#include "stdio.h"
void main()
{
int *p;
int a[10]={0,1,2,3,4,5,6,7,8,9};
int k=0;
p=a;
for(int i=0;i <10;i++,p++)
{
printf("%d\n",*p);/*ʵ¼Ê½á¹ûÊä³öÁË0-9µÄÊý×Ö*/
k++;
}
p = a;
printf("%d",*p+k);/*ʵ¼Ê½á¹ûÊä³ö20*/
}
¿´´íÌâÄ¿ÁË£¬ºÙºÙ~~~
ÄãµÄpÔÚÌø³öforÑ»·µÄʱºò£¬Êµ¼ÊÉÏ×îºó×öÁËÒ»´Î++²Ù×÷£¡ËùÒÔpÖ¸ÏòµÄÊÇa[10],¶ø²»ÊÇa[9]
Äãprintf("%d",a[10]);¿´¿´¾ÍÖªµÀΪʲôÁË
°¥Ó´
for(int i=0;i <10;i++,p++) iºÍp¶¼×Ô¼ÓÁË11´Î ËùÒÔÄãµÄPµÄΪa[10] ²»ÐÅ×Ô¼º´òÓ¡iµÄÖµ
×î½üͻȻÏë×Ô¼ºÀ´ÊµÏÖÒ»¸öÎå×ÓÆå³ÌÐò,µ«²»ÖªµÀÔõô¿ªÊ¼,×Ô¼ºÒ²Ã»Ñ§»Í¼Ðκ¯Êý,ÄÜÔÚ¿ØÖÆ̨ÏÂÖ±½ÓдÂð>>>?????
¿ØÖÆ̨£¿±ÈͼÐνçÃæ¸üÂé·³¡£
http://search.download.csdn.net/search/%E4%BA%94%E5%AD%90% ......