how the compiler treats any volatile variable?Explain with
example.
Answer / 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 |
wap in c to accept n number display the highest and lowest value
What is structure padding & expalain wid example what is bit wise structure?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
Write a simple program to find the size of different basic data types in C.
What is default value of global variable in c?
C passes By value or By reference?
5 Answers Geometric Software, Infosys,
What is the condition that is applied with ?: Operator?
Explain is it valid to address one element beyond the end of an array?
What is the purpose of main() function?
Can you mix old-style and new-style function syntax?
Program to display given 3 integers in ascending order
write a program in c language that uses function to locate and return the smallest and largest integers in an array,number and their position in the array. it should also find and return the range of the numbers , that is , the difference between the largest number and the smallest.