How to access or modify the const variable in c ?
Answer Posted / saneesh a t
Actually the keyword const is not for the programmer who work with the normal
general purpose computer. By declaring a variable as const, the compailar shows
warning/error to the modification to the variable. At runtime you can modify the memory location
using any technique, or an external hacking program can change the value of the variable.
Suppose your program is compiled to run with a microcontroller with flash or EEPROM or such
memory. Now your variable with const qualifier will be stored in the FLASH of EEPROM memory,
which cann't be modified, and the technique is used to save the RAM space which is too small in
size for a micro controller. In this case too, a FLASH/EEPROM write can chage the value of the
const varriable.
Is This Answer Correct ? | 17 Yes | 1 No |
Post New Answer View All Answers
Explain the difference between null pointer and void pointer.
There seem to be a few missing operators ..
What is difference between far and near pointers?
What is int main () in c?
p*=(++q)++*--p when p=q=1 while(q<=6)
Can math operations be performed on a void pointer?
What is the use of the function in c?
Explain threaded binary trees?
What’s a signal? Explain what do I use signals for?
Why doesnt that code work?
How is pointer initialized in c?
What is the difference between single charater constant and string constant?
What are the modifiers available in c programming language?
What is logical error?
while initialization of array why we use a[][2] why not a[2][]...?