When volatile can be used?

Answer Posted / mustafa

Volatile restricts the compiler in two ways
1-> No optimization algorithm should be applied to this
variable.
2-> When ever you need the value of the volatile variable
please take it from the memory.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function prototyping?

816


Explain one-definition rule (odr).

845


What information can an exception contain?

862


What is a base class?

786


What is the cout in c++?

761






What is the oldest programming language?

750


Explain the term memory alignment?

889


Is c++ vector a linked list?

760


Out of fgets() and gets() which function is safe to use and why?

916


Explain the use of virtual destructor?

793


What is a far pointer? where we use it?

790


What are enumerations?

837


How would you implement a substr() function that extracts a sub string from a given string?

756


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

780


What is c++ prototype?

768