Below we have listed all the Object Oriented Programming in C++ Interview Questions and answers. Feel free to comment on any Object Oriented Programming in C++ Interview Questions or answer by the comment feature available on the page.
To buy an eBook containing 30,000 Interview Questions, with Answers, Click Here.
View All Object Oriented Programming in C++ Interview Questions & Answers - Exam Mode /
Learning Mode
C++ and Object Oriented Programming. Object Oriented programming is a programming style that is associated with the concept of Class, Objects and various other concepts revolving around these two, like Inheritance, Polymorphism, Abstraction, Encapsulation etc. The prime purpose of C++ programming was to add object orientation to the C programming language, which is in itself one of the most powerful programming languages. The core of the pure object-oriented programming is to create an object, in code, that has certain properties and methods.
![]() |
what are the disadvantages of copy constructor?? | ![]() |
|
![]() |
Write a C++ program that contains a structure named ?Student? having two data members 1) Name 2) CGPA Declare array of structure ?Student? of size 10 .Populate this array by taking data from file inputFile.txt.File inputFile.txt contains Name and CGPA of the students for current semester. There is a single space between the Name and CGPA. Display the un-sorted list of students on screen. Compare the CGPAs of all the students and sort Student List with respect to CGPA in ascending or descending order. Display the sorted list of students, highest CGPA and lowest CGPA on screen and also write the result in File outputFile.txt with tab characters between the Name and CGPA. Sample InputFile.txt Ahmer 4.0 Aasim 3.5 Usman 3.4 Maria 2.4 Anila 3.0 Humza 2.6 Junaid 3.0 Talaal 3.8 Haris 3.9 Saira 2.6 Sample OutputFile.txt Sample outputFile.txt Name CGPA =============== Maria 2.4 Humza 2.6 Saira 2.6 Anila 3.0 Junaid 3.0 Usman 3.4 Aasim 3.5 Talaal 3.8 Haris 3.9 Ahmer 4.0 =============== Highest CGPA = 4.0 Lowest CGPA = 2.4 Sample output of screen: Unsorted List of Students Name CGPA Ahmer 4.0 Aasim 3.5 Usman 3.4 Maria 2.4 Anila 3.0 Humza 2.6 Junaid 3.0 Talaal 3.8 Haris 3.9 Saira 2.6 Sorted List of Students Name CGPA =============== Maria 2.4 Humza 2.6 Saira 2.6 Anila 3.0 Junaid 3.0 Usman 3.4 Aasim 3.5 Talaal 3.8 Haris 3.9 Ahmer 4.0 =============== Highest CGPA = 4.0 Lowest CGPA = 2.4 |
![]() |
|
![]() |
When do we use abstract.h?Give an example with a small program. | ![]() |
|
![]() |
How can you tell what shell you are running on UNIX system? | ![]() |
|
![]() |
What are the steps involved in designing? | ![]() |
|
![]() |
Hi, I was asked the below question in one interivew. Imagine you're maintaining a big project which is having 50k+ lines of code and as part of enhancements, you received a request to add a functionality in one of the .cpp files. For this, you need to add a new function. How do you write a new fucntion without adding a prototype to the header file (because, if you add prototype in the headerfile, the compiler has to compile all the other files). So, the requirement is not to touch the header file but add functionality in the cpp file. How do you add? |
![]() |
|
![]() |
Q1.write C++ program to accept a string and display ascii value letter by letter then display sum of all ascii values. Q2.write C++ program to accept 20 nos and then display max & min. |
![]() |
|
![]() |
What is an object? | ![]() |
|
![]() |
Differences of C and C++ Could you write a small program that will compile in C but not in C++ ? |
![]() |
|
![]() |
What will happen if I say delete this |
![]() |
|
![]() |
Given an integer N>0,write a recursive c++ function that writes the integer 1,2,.......N ? | ![]() |
|
![]() |
What do you meant by active and passive objects? | ![]() |
|
![]() |
Will it execute or not? |
![]() |
|
![]() |
List out some of the object-oriented methodologies. | ![]() |
|
![]() |
A positive integer entered through the keyboard. Write a function to obtain the prime factors of this number. For example : prime factors of 24 are 2,2,2 and 3,, where as prime factor of 35 are 5 |
![]() |
|
![]() |
What do you mean by binding of data and functions? | ![]() |
|
![]() |
How can i create a program in C++ which would input 5 random numbers, then it would arrange them in an ascending order, in descending order, from highest to lowest value and from lowest to highest value? |
![]() |
|
![]() |
What is multithreading? | ![]() |
|
![]() |
Write a program on abstract class. | ![]() |
|
![]() |
All the questions are compulsory. The first five questions shall be of 16 marks each and the last question shall be of 20 marks. Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A. Explain how a pointer to function can be declared in C++? B. List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usage in C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (?Include?) Files. |
![]() |
India News Network |