C++ OOP
Object-Oriented Programming.
C++ Object-Oriented Programming (OOP)
C++ is an object-oriented programming language.
Procedural programming is about writing procedures or functions that perform operations on the data, while object-oriented programming is about creating objects that contain both data and functions.
Object-oriented programming has several advantages:
- Faster and easier to execute
- Provides a clear structure for the programs
- Helps to keep the C++ code DRY "Don't Repeat Yourself"
- Makes the code easier to maintain, modify and debug
Classes and Objects
A class is a template for objects, and an object is an instance of a class.
When the individual objects are created, they inherit all the variables and functions from the class.