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 output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }
8 Answers MindFire, TCS, Tech Mahindra,
main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*
explain about storage of union elements.
what is y value of the code if input x=10 y=5; if (x==10) else if(x==9) elae y=8; a.9 b.8 c.6 d.7
What is the use of getchar() function?
What is static and volatile in c?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What is pointer & why it is used?
Input is "Jack and jill went up a hill" To print output is 1-letter word(s)-1 2-letter words-1 3-letter words-1 4-letter words-4
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
2 Answers Aricent, Manipal University,
Is javascript based on c?
Is main an identifier in c?