Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Why & is used in c?

1247


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

1551


How do we make a global variable accessible across files? Explain the extern keyword?

1937


In a header file whether functions are declared or defined?

1173


Explain what is the use of a semicolon (;) at the end of every program statement?

1261


What is the use of putchar function?

1108


Which type of language is c?

1119


Should a function contain a return statement if it does not return a value?

1137


How do you declare a variable that will hold string values?

1230


What is the use of pointers in C?

1133


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1132


When should the volatile modifier be used?

1234


What are qualifiers in c?

1089


What are the loops in c?

1051


What does c mean in standard form?

1245