LANGUAGES | C++ | C++ INTERVIEW QUESTION AND ANSWERS | 11

C++ Interview

C++ Interview Question and Answers:

51. 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.

52. 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.

53. What is namespace?
      The C++ language provides a single global namespace.Namespaces allow to group entities like classes, objects and functions under a name.

54. What is reference?
      Reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object.

55. What are the access specifier in c++?    
    There are three types of access specifier in c++ . They are
    Public
    protected
    private

No comments:

Post a Comment