C++ Interview Question and Answers

96. What is difference between template and macro?
  A template can be used to create a family of classes or function.A template describes a set of related classes or set of related functions in which a list of parameters in the declaration describe how the members of the set vary.
Identifiers that represent statements or expressions are called macros.
 
Your Name Your Email-ID
Your Answer
97. What is reference?
  Reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object.
 
Your Name Your Email-ID
Your Answer
98. What are the access specifier in c++?
 
    There are three types of access specifier in c++ . They are
  • Public
  • protected
  • private
 
Your Name Your Email-ID
Your Answer
99. What is difference between C++ and Java?
 
  • C++ has pointers Java does not.
  • Java is the platform independent as it works on any type of operating systems.
  • java has no pointers where c ++ has pointers.
  • Java has garbage collection C++ does not.
 
Your Name Your Email-ID
Your Answer
100. What is namespace?
  The C++ language provides a single global namespace.Namespaces allow to group entities like classes, objects and functions under a name.
 
Your Name Your Email-ID
Your Answer