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

C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

612


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

2000


hi, which software companys will take,if d candidate's % is jst 55%?

1664


Explain how do you print an address?

659


What is the argument of a function in c?

575






What are qualifiers?

617


Why is c still so popular?

618


what is stack , heap ,code segment,and data segment

2223


What is d'n in c?

636


If the size of int data type is two bytes, what is the range of signed int data type?

594


When we use void main and int main?

588


How can I access an I o board directly?

624


What is include directive in c?

646


What are the different file extensions involved when programming in C?

758


What is a pointer variable in c language?

645