C++ Interview Question and Answers

111. What is the difference between a copy constructor and an overloaded assignment operator?
  A copy constructor constructs a new object by using the content of the argument object. An overloaded assignment operator assigns the contents of an existing object to another existing object of the same class.
 
Your Name Your Email-ID
Your Answer
112. What is a virtual destructor?
  The simple answer is that a virtual destructor is one that is declared with the virtual attribute.
 
Your Name Your Email-ID
Your Answer
113. What do you mean by Stack unwinding?
  It is a process during exception handling when the destructor is called for all local objects between the place where the exception was thrown and where it is caught.
 
Your Name Your Email-ID
Your Answer
114. What is STL? and what are the components of stl?
 
    A collection of generic classes and functions is called as Standard Template Library (STL).The stl components are
  • containers
  • Algorithm
  • Iterators
.
 
Your Name Your Email-ID
Your Answer
115. What is a modifier?
 
  • A modifier, also called a modifying function is a member function that changes the value of at least one data member.
  • In other words, an operation that modifies the state of an object.
  • Modifiers are also known as mutators.
 
Your Name Your Email-ID
Your Answer