OOP using C++
Classes & Objects
, Object Oriented Programming
• Programmer thinks about and defines the
attributes and behavior of objects.
• Often the objects are modeled after real-
world entities.
• Very different approach than function-based
programming (like C).
, Object Oriented Programming
• Object-oriented programming (OOP)
– Encapsulates data (attributes) and functions
(behavior) into packages called classes.
• So, Classes are user-defined (programmer-
defined) types.
– Data (data members)
– Functions (member functions or methods)
• In other words, they are structures + functions