what is volatile in c language?

Answer Posted / s.m.faisal

volatile reduces the optimization .optimization means compiler should not make out that the variable has not changed its value so it reads the value directly from the register.
So while using volatile keyword compiler will directly access the variable from the memory not from the register bcz the value of the variable can be changed outside or inside the program.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What will be the outcome of the following conditional statement if the value of variable s is 10?

768


How can I implement sets or arrays of bits?

608


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

3734


What are the two types of functions in c?

568


How many loops are there in c?

583






what is event driven software and what is procedural driven software?

2018


How to write a multi-statement macro?

626


How are Structure passing and returning implemented by the complier?

716


What is #include stdio h and #include conio h?

604


What is declaration and definition in c?

526


What is the heap?

688


What is exit() function?

562


Is a house a mass structure?

643


What is volatile c?

526


Why do we use static in c?

635