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
What are types of structure?
What is pointer to pointer in c language?
What is the method to save data in stack data structure type?
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
Write a program for Overriding.
What is a function in c?
How can I change their mode to binary?
what will be maximum number of comparisons when number of elements are given?
Explain what standard functions are available to manipulate strings?
What is the difference between near, far and huge pointers?
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
When is a null pointer used?
Explain what is page thrashing?
Write a program to check palindrome number in c programming?
What is the use of define in c?