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
Explain what does it mean when a pointer is used in an if statement?
What are actual arguments?
What is omp_num_threads?
Explain modulus operator.
How can I direct output to the printer?
Why shouldn’t I start variable names with underscores?
What is the size of structure pointer in c?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
What is #line used for?
What is pivot in c?
What is the difference between procedural and functional programming?
Are global variables static in c?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include
Can you return null in c?
What is memcpy() function?