Tuesday, September 11, 2007

TECH QUES (9/11)

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

3 comments:

  1. how can a pointer be incremented????

    ReplyDelete
  2. the correct ans is...........
    U GET AN ERROR.. BCOZ... CONST VALUE CANNOT BE CHANGED...

    ReplyDelete
  3. 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".

    ReplyDelete