When volatile can be used?

Answer Posted / qqlin

it means this value will be changed unexpectedly. everytime
the program wants to use it, it can only be got from memory
but not from the register directly.

if you want a variable can be accessed by several threads,
you need this key word, like in ISR program, etc.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State two differences between C and C++.

610


What is buffering in c++?

587


How do you sort a sort function in c++ to sort in descending order?

559


Differentiate between a pointer and a reference with respect to c++.

695


What is the C-style character string?

605






Why is c++ still popular?

587


Why do we need function?

599


what kind of projects are suitable for c and c++

629


How do I start a c++ project?

587


How does a copy constructor differs from an overloaded assignment operator?

556


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

745


What do you mean by friend class & friend function in c++?

620


What are the uses of c++ in the real world?

562


What are 2 ways of exporting a function from a dll?

616


What do you mean by funtion prototype?

590