Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 1

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 502

Answer:

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


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

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 1 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: