How to access or modify the const variable in c ?

Answer Posted / varunreddy

try this it will work:

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

*(int *)&i=i++;
printf("%d\n",i);

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 c language used for?

549


Explain what is the stack?

622


What are the restrictions of a modulus operator?

623


Which header file is used for clrscr?

565


What are qualifiers in c?

560






How the c program is executed?

616


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

591


How will you delete a node in DLL?

671


What is a double c?

580


On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area

643


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3491


What is abstract data structure in c?

514


Why doesnt this code work?

607


In C language what is a 'dangling pointer'?

626


What is a program flowchart?

590