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


Please Help Members By Posting Answers For Below Questions

can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......

1647


Why c is called top down?

877


What is the default value of local and global variables in c?

798


How do you do dynamic memory allocation in C applications?

857


What is array of structure in c programming?

1047


This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory

1020


how many key words availabel in c a) 28 b) 31 c) 32

847


What are actual arguments?

878


When should we use pointers in a c program?

894


What is difference between constant pointer and constant variable?

951


List some of the dynamic data structures in C?

1032


What is an operator?

871


Tell us bitwise shift operators?

831


What is void main ()?

832


What is pointer to pointer in c language?

821