O'Reilly logo

Object-oriented Programming Using C++ and Java by Anand Vasappanavara, Gautam Vasappanavara, Ramesh Vasappanavara

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10

Classes

LEARNING OBJECTIVES

At the end of this chapter, you should be able to

  • Write C++ programs using classes and objects.

  • Understand concepts of constructors, destructors, and member data and functions.

  • Understand container classes and their usage.

  • Understand friend functions and inline functions.

  • Understand objects and dynamic memory usage with pointers and reference.

  • Understand this operator and static declarations and their usage.

10.1 Introduction

We use class in C++ to define our own data type. A class is a derived data type like an array. The difference is that in an array you have single data type, while in a class data type you can have different data types. These different data types can be intrinsic data types such as int, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required