Examveda
Examveda

Determine output:
void main()
{
      int const *p=5;
      printf("%d", ++(*p));
}

A. 6

B. 5

C. Garbage Value

D. Compiler Error

Answer: Option D

Solution(By Examveda Team)

p is a pointer to a "constant integer". But we tried to change the value of the "constant integer".

Join The Discussion

Comments ( 2 )

  1. Intresting Video's
    Intresting Video's :
    6 months ago

    int i=5;
    int const *p=&i;
    this is pointer to const or not

  2. Ramu Chowdary
    Ramu Chowdary :
    2 years ago

    if there is only ++p what is the answer

Related Questions on C Miscellaneous