How to access or modify the const variable in c ?

Answer Posted / varunreddy

a small modification to answer #13

#include<stdio.h>
int main()
{
const int a=10;

*(int *)&a=25
printf("%d\n",a);
return 0;
}

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is p in text message?

534


Why static is used in c?

616


What is the difference between struct and union in C?

566


Why C language is a procedural language?

614


What is difference between arrays and pointers?

575






What are the advantages of using Unions?

642


Difference between constant pointer and pointer to a constant.

607


Why are algorithms important in c program?

614


Why isn't it being handled properly?

641


What is array in c with example?

610


What is nested structure in c?

604


List the difference between a "copy constructor" and a "assignment operator"?

576


What is scope of variable in c?

555


Explain what is the difference between functions abs() and fabs()?

613


Explain the difference between the local variable and global variable in c?

593