Saturday, March 27, 2010

71

Prdict the output:

int incr(int *pt);
int main()
{
int value=2;
int *ptr;
ptr=&value;
printf("%d %d",*ptr,value);
incr(ptr);
printf("\n%d %d",*ptr,value);
return 0;
}
int incr(int *pt)
{
(*pt)++;
return 0;
}

Output:
2 2
3 3

0 comments:

Post a Comment