Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

Technical Interview Questions and Answers :: C++

  • 21. 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 :
    Tags:

    No Tags on this question yet!

  • 22. 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 :
    Tags:

    No Tags on this question yet!

  • 23. 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 :
    Tags:

    TCS Accenture 

  • 24. 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 :
    Tags:

    TCS Accenture 

  • 25. 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 :
    Tags:

    Capgemini Syntel Inc. 

  • 26. 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 :
    Tags:

    No Tags on this question yet!

  • 27. 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 :
    Tags:

    TCS Capgemini 

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

    No Discussion on this question yet!

    Please Login First :
    Tags:

    TCS Accenture 

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

    No Discussion on this question yet!

    Please Login First :
    Tags:

    No Tags on this question yet!

  • 30. 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 :
    Tags:

    TCS 

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.