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...

what is difference b/w extern & volatile variable??

Answer Posted / anonimos

volatile variables are used on RT Embedded systems to
interface a physical memory mapped/IO mapped cell on the
computer board (volatile pointer).

Example define IO port:
#define PortA (*(volatile unsigned char *)0x3b)
unsigned char inputValue=PortA;

optimization may attempt to perform paging to hard drive of
to cache or even CPU registers so when reading from the
physical location in Mem/IO space the program will actually
read old value that was paged/cached by optimization
algorithm of the computer/board, even after the Input
changed on this Memory/IO cell.

volatile instruct the compiler to prevent optimization by
caching to registers/cache.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is struct node in c?

1123


What is restrict keyword in c?

1166


What is n in c?

1109


What is a static variable in c?

1167


Where is volatile variable stored?

1142


which is conditional construct a) if statement b) switch statement c) while/for d) goto

1261


What is use of bit field?

1349


What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

1394


How many keywords are there in c?

1123


pierrot's divisor program using c or c++ code

2284


What is the use of function in c?

1247


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

1152


How many types of operators are there in c?

1087


What are linked lists in c?

1177


Explain the concept and use of type void.

1165