What is volatile
Answers were Sorted based on User's Feedback
Answer / ravi.jnv
Volatile is to inform the compiler that not to optimise
code.
for ex:
int a = port1;
int b = port1;
int c = port1;
compiler may convert it as
int a=b=c=port1;
so avoid it , u have to use volatile keyword.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / nikhil
Basically, it is a type qualifier.
a volatile data type is used at optimizer level.
Generally, in the embedded coding, When the optimizer is Set
on "favor size". The data type declaration as volatile
declares to compiler that the value of this data type can
change beyond the program flow(like interrupts.
Otherwise if the optimizer is enable, the program malfunctions.
| Is This Answer Correct ? | 1 Yes | 1 No |
What is the use of volatile?
write a c program to print the values in words eg:- 143 written it has (one hundred and forty three)& 104, 114 are also written words
5 Answers Captronic, DELL, Google, IBM, Mithi, RCC, Wipro,
define c
what is pointer ? what is the use of pointer?
What are the different types of data structures in c?
what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d",x); }
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?
what are the general concepts of c and c++
How do shell structures work?
What is volatile
How we can insert comments in a c program?
Difference between for loop and while loop?