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 are the disadvantages of c language?
Read two numbers from keyboard and find maximum of them?
How arrays can be passed to a user defined function
Why is sprintf unsafe?
pgm in c to reverse string by word using array(god is love becomes love is god) (no additional array can used,space is only delimiter between words )
What is the use of getchar functions?
What is a protocol in c?
In which layer of the network datastructure format change is done
How the c program is executed?
what are the interview question's in the language c
In C program, at end of the program we will give as "return 0" and "return 1", what they indicate? Is it mandatory to specify them?
Program to trim a given character from a string.