Sunday, November 9, 2008

C tricky questions.... ( Stage 1 people )

1. void main()
{
int const * p=5;
printf("%d",++(*p));
}

1 comment:

shivachitta said...

1) Answer:
Compiler error: Cannot modify a constant value.
Explanation:
p is a pointer to a "constant integer". But we tried to change the
value of the "constant integer".