Code:
#include <stdio.h>
#include <conio.h>
void fun(int , int*);
int main(void){
int a, i;
int x = 100,y = 200, z = 300;
int myArr[] = {18,22,3};
int *ptr1, *ptr2;
ptr1 = &y;
ptr2 = &z;
printf("%d\n",*ptr1 + x);
a = *ptr2;
ptr2 = &x;
printf("%d %d\n",a, *ptr2);
fun(a, myArr);
ptr1 = myArr;
printf("%d\n",*ptr1++);
ptr1--;
printf("%d\n",--(*ptr1));
getch();
return 0;
}
void fun(int b , int* pr){
int *p;
for(p = pr; p < pr+3; p++)
*p = *p + b;
printf("%d\n",*--p);
}
For the coding above, what will *p be? what is the value? I have problems tracing this coding..