C++ Important Questions

C++ (OOP) IMPORTANT QUESTIONS FOR EXAMS:
Chapter 1: Introduction to OOP [5 marks]
1. What is OOP? Explain the features and benefits of OOP.
2. Differentiate between OOP and POP.
3. What is structured programming. Discuss characteristics and problems related with structured programming.
Chapter 2: Basics of C++ Programming [5 marks]
2. What is function overloading. Explain with examples.
3. Explain inline functions with examples.
5. Differentiate between library function and user-defined function.
Chapter 3: Classes and Objects [5/10 marks]
1. Why constructor and deconstructor are required in OOP? Explain with examples.
2. What is constructor? Explain their types and their special characteristics.
3. How a member function of class defined? Define friend function. What are the merits and demerits of using friend function?
4. How can you classify objects? Why dynamic objects are needed? Explain with examples.
5. What do you mean by dynamic initialization of variables and how can you achieve it?
6. Define deconstructor. Explain the importance of deconstructor.
7. How can you define a member function outside a class? Explain with suitable example.
Chapter 4: Operator Overloading [5/10 marks]
1. Explain the concept and benefits of operator overloading. List the operators that cannot be overloaded. Give an example of program of operator overloading.
2. Explain the concept of type conversions.
3. Differentiate between operator overloading and function overloading.
Chapter 5: Inheritance [5/10 marks]
2. How can we use inheritance of code reusability?
3. What is the role of protected access specifiers in inheritance? Explain with examples.
4. Differentiate between private, public and protected variable with suitable examples.
5. Differentiate between base(parent) class and derived(child) class.
Chapter 6: Polymorphism [5/10 marks]
2. Difference between virtual function and pure virtual function.
3. Difference between base class and derived class.
4. Difference between container class and inheritance.
5. Explain the concept behind macros. Write a program to find area of circle using macro.
6. Define friend function and give its example.
Chapter 7: Function Template and Exception Handling [5 marks]
1. What is a template? Differentiate a function template and class template.
2. Explain function template with examples.
3. Define try, throw and catch statement in C++ with examples.
4. Explain the exceptional handling with examples.
Chapter 8: File Handling [5 marks]
1. Why is file handling required? Explain with suitable example.
2. Explain the feature of I/O system supported by C++.
3. How is character I/O different from binary I/O? Explain.
4. Write short notes on:
- Cascading of I/O operators
- Pure Virtual Function