hanikhattab100: It's a way of creating a structure that holds both data, and special code that can operate on the data.
These structures are then combined to solve problems.
Example: You can define a Baseball Player object. This can include name, address, hitting average, position and history.
So you instantiate a bunch of these.
You might then define a Baseball Team object. This acts as both a container for a bunch of Baseball Player objects.
Then you might define a Baseball Game object. This takes 2 Baseball Team objects and then comparing Pitchers, Hitters and Field players, can simulate a game.
THE POINT: The "Object" nature of things help you organize the program at a high level.
Inheritance: You can then do 1 better. You create 'abstract' player, abstract team and abstract game objects.
All the variables and code are for generic things like player names or team scores. But now a developer can build on these for a Baseball team, Soccer team, Football team, etc.
The "Promise" of Object Oriented programming is you can build new programs by building on base or abstract objects so you do not re-write a bunch of things from scratch.
Programming in a language that supports the big 3 constructs:
and using those language features as an integral part of your code.
C++ is an object oriented language (supports the big 3 constructs), but it is possible to use the C subset to write non-object oriented code. So if you're using the object oriented features of C++ to build your code, then you're doing object oriented programming. Otherwise, you're not doing object oriented programming (you're either doing procedural programming, structured programming, or writing spaghetti code — all of which are possible with C and C++.)
[now that i think about it, it's the big 4 constructs, but I can't remember the 4th one off the top of my head. I'm sure someone else will know it off the top of theirs.] XD
A style of programming where actions are based on objects instead of linear programming.
A container for standardized functions assigned to constructed and destructible variables.