What is volatile

Answers were Sorted based on User's Feedback



What is volatile..

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

What is volatile..

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

Post New Answer

More C Interview Questions

An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

0 Answers  


What is a stream water?

0 Answers  


What is the difference between volatile and const volatile?

0 Answers  


Are there any problems with performing mathematical operations on different variable types?

0 Answers  


write a function for strtok()??

2 Answers   Verifone,






What is volatile

2 Answers  


1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.

4 Answers   Ignou, TCS,


Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above

0 Answers  


If an old women's age is the same as her three grand daughters i,mean the number of days old child=the no of weeks old child=no of months old child .The total yrs of all these ppl is 114 yrs...then how old is the old woman? the yr has 365 days..and 30 days each month.

1 Answers   TCS,


Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

0 Answers  


what is mean by Garbage collection ? Please answer me. Advance thanks.

4 Answers   Excel,


How to reverse alternate words in a given line of string For Eg: my name is narasimha output : my eman is ahmisaran

0 Answers  


Categories