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

Are local variables initialized to zero by default in c?

0 Answers  


What is header file in c?

0 Answers  


int far *near * p; means

0 Answers   Honeywell,


Which is better malloc or calloc?

0 Answers  


What are the different types of objects used in c?

0 Answers  






Explain pointer. What are function pointers in C?

0 Answers   HCL,


What is array of structure in c?

0 Answers  


which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....

2 Answers  


Given a number N, product(N) is the product of the digits of N. We can then form a sequence N, product(N), product(product(N))… For example, using 99, we get the sequence 99, 99 = 81, 81 = 8. Input Format: A single integer N Output Format: A single integer which is the number of steps after which a single digit number occurs in the sequence. Sample Test Cases: Input #00: 99 Output #00: 2 Explanation: Step - 1 : 9 * 9 = 81 Step - 2 : 8 * 1 = 8 There are 2 steps to get to this single digit number. Input #01: 1137638147

2 Answers  


write a program for 4 4 3 3 3 3 2 2 2 2 2 2 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 4 4

1 Answers  


Describe wild pointers in c?

0 Answers  


how to print 212 as Twohundreds twelve plz provide me ans soon

1 Answers  


Categories