C++ Interview Question and Answers

26. What is iterator class?
 
  • Iterator class provides an access to the class which are inside the containers(it holds a group of objects in an organized way).
  • The containers include the data structure, class and abstract data type.
 
Your Name Your Email-ID
Your Answer
27. What are the types of declarations in C++?
 
    There are so many types of declaration in C++ are :
  • Variable declaration
  • Constant declaration
  • Function declaration
  • Object declaration
 
Your Name Your Email-ID
Your Answer
28. What are Smart pointers?
  Smart pointers are almost similar to pointers with additional features such as automatic destruction of a variable when it becomes out of scope and the throwing of exceptions that ensures the proper destruction of the dynamically allocated objects.
 
Your Name Your Email-ID
Your Answer
29. Explain function template?
  Function template provides a means to write generic functions for different data types such as integer, long, float or user defined objects.
 
Your Name Your Email-ID
Your Answer
30. Explain class template?
  Class template provides a means to write a generic class for different types so that a class can have members based on generic types that do not need to be defined at the moment of creating the class or whose members use these generic types.
 
Your Name Your Email-ID
Your Answer