ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  C++ General
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
When volatile can be used?
 Question Submitted By :: Shalini
I also faced this Question!!     Rank Answer Posted By  
 
  Re: When volatile can be used?
Answer
# 1
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 ?    0 Yes 0 No
Qqlin
 
  Re: When volatile can be used?
Answer
# 2
One more thing i want to add in above answer that is if 
compiler sees keyword volatile it skips that variable from 
optimization of code, becasue since it is very dymanic in 
nature and to manage such type of variable for 
optimaization is costly.
 
Is This Answer Correct ?    0 Yes 0 No
Reejusri
[********]
 
 
 

 
 
 
Other C++ General Interview Questions
 
  Question Asked @ Answers
 
const char * char * const What is the differnce between the above two? TCS8
Describe functional overloading? HP3
Can you explain the term "resource acquisition is initialization?"  1
what is the diff b/n c and c++ a. dynamic scoping b. nested switching c. declaration of variables in any code block d. separation of compilation and linking Hughes1
What happens if an exception is throws from an object's constructor and from object's destructor? TCS2
What does '\r' and '\b' mean? Please explain with example.  2
Explain the ISA and HASA class relationships. How would you implement each in a class design?  2
template<class T, class X> class Obj { T my_t; X my_x; public: Obj(T t, X x) : my_t(t), my_x(x) { } }; Referring to the sample code above, which one of the following is a valid conversion operator for the type T? a) T operator T () { return my_t; } b) T operator(T) const { return my_t; } c) operator(T) { return my_t; } d) T operator T (const Obj &obj) { return obj.my_t; } e) operator T () const { return my_t; } Quark1
What is the Maximum Size that an Array can hold? Satyam31
What is size of null class? HP3
What is Memory Alignment? TCS1
What are the differences between a struct in C and in C++? Wipro4
What are Binay tress and B trees? Diff between them? CTS3
Can inline functions have a recursion? Give the reason?  1
Memory is not a constraint. In a single iteration(NOTE: you can't go back), how will you find out the 10th last node/item in a linked list. Goldman-Sachs8
Which of the Standard C++ casts can be used to perform a ?safe? downcast: a) reinterpret_cast b) dynamic_cast c) static_cast d) const_cast Quark1
What is problem with Runtime type identification?  1
What is Virtual Inheritance? Wipro2
What are the types of STL containers?  1
What is object slicing and how can we prevent it? Tech-Mahindra2
 
For more C++ General Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com