Take FREE!! Online AMCAT Mock Test to Crack Wipro NLTH, Capgemini, etc.
Get Off-Campus Placement Jobs Info !!!
Practice Given Here Wipro NLTH Practice Q&A

Technical Interview Questions and Answers :: C++

    21 / 184

    What are "VTABLE" and "VPTR" ?
    Answer:

    The virtual table(vtable) is a lookup table of functions used to resolve function calls in a dynamic/late binding manner. vPtr is set (automatically) when a class instance is created so that it points to the virtual table for that class. vPtr is inherited by derived classes,

    Please Login First :

    22 / 184

    What is static member function and explain its characteristics
    Answer:

    A member function that is declared static has following property,
    • A static function can have access to only other static members declared in the same class.
    • A static member function can be called using the same class name as follows
    class_name:: function_name;

    Please Login First :

    23 / 184

    What Is Inheritance? What is the diamond problem that can occur with multiple inheritance? Explain an example.
    Answer:

    Inheritence is deriving parent(base) class properties to derived class.


    The Diamond Problem :


        A


       /  \


      B   C


       \   /


        D


    Now Class B

    Please Login First :

    24 / 184

    List the types of inheritance supported in C++.
    Answer:

    There are 5 forms available, namely
    • Single inheritance: A derived class with only one base class
    • Multiple inheritance: A derived class with only several base class
    • Hierarchical inheritance: The traits one class may be inherited by more than one class
    • Multilevel inheritance:
    • Hybrid inheritance: it is a combination of multiple and hierarchical inheritance.

    Please Login First :

    25 / 184

    What is Copy Constructor? Write a program using it.
    Answer:

    Copy constructor is used to declare and initialize an object from another object.
    For example, the statement
    Integer I2(I1);
    Would define the object I2 and at the same time initialize it to the values of I1. another form of this statement is integer I2=I1;
    The process of initializing through a copy constructor is known as copy initialization. A copy constructor takes a reference to an object of the same class as itself as an argument.

    Please Login First :

    26 / 184

    Function overloading VS Operator Overloading
    OR
    What is the difference between function overloading and operator overloading? And what are the advantage of it.
    Answer:

    No Discussion on this question yet!

    Please Login First :

    27 / 184

    Explain about Friend function and friend class.
    Answer:

    Friend Function:
    A friend function can access a class private data, even though it is not a member function of the class. This is useful when one function must have access to two or more unrelated classes and when an overloaded operator must use, on its left side, a value of a class other than one of which it is a member. Friends are also used to facilitate functional notation.

    Friend Class:
    It is possible to grant a non-member function access to the private members of a class by using a friend. A friend function has access to all private and protected members of the class for which it is a friend.

    Please Login First :

    28 / 184

    Point out difference Malloc() vs new and Delete vs Free
    Answer:

    No Discussion on this question yet!

    Please Login First :

    29 / 184

    What are difference/comman points Structure vs class in C++
    Answer:

    No Discussion on this question yet!

    Please Login First :

    30 / 184

    Why the size of empty Class is one byte?
    OR
    What will the sizeof empty Class ?
    Answer:

    No Discussion on this question yet!

    Please Login First :



You can check latest and updated C++ Interview Questions and Answers C++ Programming Online on this page. You can filter the question set by the company's name. Looking for the right answer? Don't worry! You can click on view answer section and check the answer with the explanation. You can discuss the answer in the forum with other users easily. Login with Facebook and save the answer To Reading List right now!

Our site contains top IT companies placement paper and mock test to help the freshers and experienced candidate to get hands on experience on the pattern and type of questions. We have curated all the C++ technical interview questions and answers from previous candidates.