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
What is struct node in c?
What is restrict keyword in c?
What is n in c?
What is a static variable in c?
Where is volatile variable stored?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
What is use of bit field?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
How many keywords are there in c?
pierrot's divisor program using c or c++ code
What is the use of function in c?
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
How many types of operators are there in c?
What are linked lists in c?
Explain the concept and use of type void.