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
Can you please explain the difference between exit() and _exit() function?
What is the difference between fread and fwrite function?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
I need testPalindrome and removeSpace
#include
Write a program to reverse a given number in c?
What is the acronym for ansi?
How we can insert comments in a c program?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
i have a written test for microland please give me test pattern
What is an expression?
find the sum of two matrices and WAP for it.
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
What is the difference between far and near ?
How can I implement sets or arrays of bits?