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 volatile c?

509


A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(

1724


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1420


What is the advantage of c?

604


Explain what will the preprocessor do for a program?

589






Can you return null in c?

586


How can I find out if there are characters available for reading?

631


What is gets() function?

656


Is struct oop?

570


How to declare a variable?

557


What is the use of a semicolon (;) at the end of every program statement?

752


How can my program discover the complete pathname to the executable from which it was invoked?

650


How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

603


Explain indirection?

631


What library is sizeof in c?

557