POINTER ARTHMETIC EXAMPLE 2
void main()
{
int a=10,b=20;
int*p=&a,*q=&b;
printf("%u,%u\n",p,q);
printf("%u\n",p+2);
printf("%u\n",p-2);
/*
printf("%u\n",p*2); */
printf("%u\n",q-p);
/*printf("%u\n",p+q); illegal */
}
OUTPUT
6356724,6356720
6356732
6356716
4294967295
No comments:
Post a Comment