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 the concatenation operator?

865


How #define works?

869


Why functions are used in c?

873


write a program in c language to print your bio-data on the screen by using functions.

6567


How many levels of pointers have?

827


What is an operator?

870


Explain how to reverse singly link list.

867


What is use of #include in c?

851


What is the scope of global variable in c?

782


Can you assign a different address to an array tag?

931


What is the difference between text and binary modes?

902


What is the meaning of 2d in c?

851


How do you determine the length of a string value that was stored in a variable?

895


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1671


Differentiate between functions getch() and getche().

829