| |
10.5.3.When the pointer is incremented by an increment operator, it is always right incremented. |
|
#include <stdio.h>
main(){
int a[5];
int i;
for(i = 0;i<5;i++){
a[i]=i;
}
int *b;
b=a;
for(i = 0;i<5;i++)
{
printf("value in array %d and address is %16lu\n",*b,b);
b++;
}
}
|
|
#include <stdio.h>
main(){
long a[5];
int i;
for(i = 0;i<5;i++) {
a[i]=i;
}
long *b;
b=a;
for(i = 0;i<5;i++)
{
printf("value in array %d and address is %16lu\n",*b,b);
b++;
}
}
|
|
value in array 0 and address is 631652
value in array 1 and address is 631656
value in array 2 and address is 631660
value in array 3 and address is 631664
value in array 4 and address is 631668 |
|