Constant value in c/c++

void main()
{
int const *p=5;
printf(“%d”,++(*p));
}
c/c++ Tutorial Answer:Compiler error: cannot modify a constant value
Debugging solution:First we can not change the constant value.soP is a pointer to a “constant integer”, but we tried to change the value of the “constant integer”

Post a Comment

0 Comments