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++

  • 1. Can we define classes under interface?
  • Answer:

    No, classes cannot be defined under interface. In C , a pure virtual function is required to make a class as an abstract class.

    Please Login First :
    Tags:

    No Tags on this question yet!

  • 2. What are the OOPS concepts? and What are the use of OOPs concept?
  • Answer:

    1) Encapsulation: It is the mechanism that binds together code and data in manipulates, and keeps both safe from outside interference and misuse. In short it isolates a particular code and data from all other codes and data. A well-defined interface controls the access to that particular code and data.
    2) Inheritance: It is the process by which one object acquires the properties of another object. This supports the hierarchical classification. Without the use of hierarchies, each object would need to define all its characteristics explicitly. However, by use of inheritance, an object need only define those qualities that make it unique within its class. It can inherit its general attributes from its parent. A new sub-class inherits all of the attributes of all of its ancestors.
    3) Polymorphism: It is a feature that allows one interface to be used for general class of actions. The specific action is determined by the exact nature of the situation. In general polymorphism means "one interface, multiple methods"; this means that it is possible to design a generic interface to a group of related activities. This helps reduce complexity by allowing the same interface to be used to specify a general class of action. It is the compiler's job to select the specific action (that is, method) as it applies to each situation.

    Please Login First :
    Tags:

    Wipro Aricent Tech Mahindra 

  • 3. What is a container class?
  • Answer:

    A container class is a class that is used to hold objects in memory or external storage. A container class acts as a generic holder. A container class has a predefined behaviour and a well-known interface.

    Please Login First :
    Tags:

    Aricent TCS 

  • 4. What is a token?
  • Answer:

    A token is the smallest element of a C program that is meaningful to the compiler. The C parser recognizes these kinds of tokens: identifiers, keywords, literals, operators, punctuators, and other separators. A stream of these tokens makes up a translation unit.

    Please Login First :
    Tags:

    No Tags on this question yet!

  • 5. What is a preprocessor?
  • Answer:

    Preprocessor directives are lines included in the code of programs preceded by a hash sign (#). These lines are not program statements but directives for the preprocessor. The preprocessor examines the code before actual compilation of code begins and resolves all these directives before any code is actually generated by regular statements.

    Please Login First :
    Tags:

    No Tags on this question yet!

  • 6. What are limitations of union?
  • Answer:

    This means if one member variable of union is updated then the rest will be updated as well. This also leads compilation error when initializing multiple members at a time as the memory locations are not different. So in case of union only one member should be initialized at a time.

    Please Login First :
    Tags:

    TCS 

  • 7. What is the difference between declaration and definition?
  • Answer:

    In C , function declaration is means telling the compiler that a function occurs but there's no definition given to it. When in the program, the function with definition is given, it's known as function definition.



    For eg.: void display();//function declaration



    void display){ cout<<"Function Definition";}//Function Definition

    Please Login First :
    Tags:

    No Tags on this question yet!

  • 8. How can we access private members of a classs?
  • Answer:

    By using a friend function.
    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 

  • 9. What are the differences between C and C++?
  • Answer:

    1. C can run most of the code of C, but C can't run C code.



    2. C supports procedural programming paradigm whereas C supports both procedural and object oriented programming paradigm.



    3. C is a function driven and C is an object driven language.



    4. C doesn't allow function definitions within structures whereas in C function definition can be within structures.



    5. C doesn't support reference variables but C does support. 

    Please Login First :
    Tags:

    Wipro TCS 

  • 10. What are the major Differences between JAVA and C++ ?
  • Answer:

    1. C supports pointers, Java doesn't.



    2. Multiple inheritence is supported in C but not in Java.



    3. Java has built-in support for threads whereas C doesn't have built-in support for threads.



    4. No destructors in Java but C has them.



    5. C supports both method and operator overloading, Java only supports method overloading.

    Please Login First :
    Tags:

    Wipro TCS 

You can check latest and updated C++ technical interview questions and answers 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.