08/12/2025
Q1. What is C++?
C++ is an object-oriented programming language that supports both procedural and OOP concepts.
Q2. What is OOP?
Object-Oriented Programming organizes code using objects and classes.
Q3. What are the main OOP pillars?
Encapsulation, Inheritance, Polymorphism, Abstraction.
Q4. What is a class?
A class is a blueprint for objects.
Q5. What is an object?
An object is an instance of a class.
Q6. What is constructor?
A special method called automatically when an object is created.
Q7. What is destructor?
A method that is executed when an object is destroyed.
Q8. What is function overloading?
Same function name with different parameters.
Q9. What is operator overloading?
Using operators with user-defined meanings.
Q10. What is inheritance?
When one class derives features from another class.
Q11. Types of inheritance?
Single, Multiple, Multilevel, Hierarchical, Hybrid.
Q12. What is polymorphism?
One function behaving differently (overloading/overriding).
Q13. What is virtual function?
A function that can be overridden in derived classes.
Q14. What is pure virtual function?
A function declared but not defined β used for abstraction.
Q15. What is an abstract class?
A class with at least one pure virtual function.
Q16. What is encapsulation?
Wrapping data and functions into a single unit (class).
Q17. What is a namespace?
Used to avoid naming conflicts.
Q18. What is STL?
Standard Template Library β includes vectors, lists, maps, queues, etc.
Q19. What is a vector?
A dynamic array that can grow or shrink.
Q20. What is pointer?
A variable that stores memory address.
Q21. What is reference variable?
An alias for another variable.
Q22. What is memory leak?
Losing access to allocated memory (not freed).
Q23. What is βthisβ pointer?
Pointer that stores the address of the current object.
Q24. What is friend function?
A function that can access private members of a class.
Q25. What is exception handling?
Handling runtime errors using tryβcatch blocks