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
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
Are bit fields portable?
Is sizeof a keyword in c?
What is the use of sizeof?
What is the difference between text and binary modes?
Is this program statement valid? INT = 10.50;
What is bash c?
How can I read a binary data file properly?
When can a far pointer be used?
c language interview questions & answer
What is the right way to use errno?
What are the key features in c programming language?
What is ambagious result in C? explain with an example.
How many levels of indirection in pointers can you have in a single declaration?
What is the most efficient way to store flag values?