What is the use of volatile keyword in c++? Give an example.
The volatile keyword is intended to prevent the compiler from applying any optimizations on objects that can change in ways that cannot be determined by the compiler. Objects declared as volatile are omitted from optimization because their values can be changed by code outside the scope of current code at any time.
Is This Answer Correct ? | 0 Yes | 0 No |
Which operations are permitted on pointers?
List the types of polymorphism in c++?
how to find the maximum of 10 numbers ?
What are the advantages of inheritance in c++?
How to declare a function pointer?
when can we use copy constructor?
Difference between static global and global?
16 Answers Microsoft, Symphony, Wipro,
catch(exception &e) { . . . } Referring to the sample code above, which one of the following lines of code produces a written description of the type of exception that "e" refers to? a) cout << e.type(); b) cout << e.name(); c) cout << typeid(e).name(); d) cout << e.what(); e) cout << e;
If I is an integer variable, which is faster ++i or i++?
What should main() return in c and c++?
What happens if an exception is throws from an, object's constructor and object's destructor?
Write a program to calculate the BMI of a person using the formula BMI = weight/height2.