how the compiler treats any volatile variable?Explain with
example.
Answer Posted / daniboy
A volatile variable is one whose VALUE CAN CHANGE
UNEXPECTEDLY. Consequently, the compiler can make NO
ASSUMPTIONS about the value of the variable. In
particular, the optimizer must be careful to RELOAD the
variable every time it is used instead of holding a copy in
a register.
Examples of volatile variables are:
(a) Hardware registers in peripherals (e.g., status
registers)
(b) Non-stack variables referenced within an interrupt
service routine.
(c) Variables shared by multiple tasks in a multi-
threaded application.
Source: 10 Best Questions to would-be Embedded Programmers -
By Nigel Johns
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Is python a c language?
Why main function is special give two reasons?
Explain how can you be sure that a program follows the ansi c standard?
Write a function that will take in a phone number and output all possible alphabetical combinations
What will be your course of action for a push operation?
Explain what are the standard predefined macros?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
What are the general description for loop statement and available loop types in c?
What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?
Write a program to show the change in position of a cursor using c
Explain what are multidimensional arrays?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
Difference between pass by reference and pass by value?
What is hungarian notation? Is it worthwhile?