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


This Question Belongs to C Program >> C Miscellaneous

Join The Discussion

Comments ( 2 )

  1. Intresting Video's
    Intresting Video's :
    4 years ago

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

  2. Ramu Chowdary
    Ramu Chowdary :
    6 years ago

    if there is only ++p what is the answer

Related Questions on C Miscellaneous