Murach's C++ 2008
How to create and use classes
This chapter shows you how to create your own C++ classes
that include fields, properties, methods, constructors, and
static methods. While many competing books illustrate these
concepts with unrealistic objects such as automobiles or animals,
this book uses real-world business objects such as products
and customers.
In fact, this chapter presents an application
that uses a Product class to create Product objects and a
ProductDB class that uses static methods to handle the application's
database access. That's the type of complete application that
you need to see if you want to understand object-oriented
programming in C++.
|
|
|
|
How classes can be used to structure
an application |
334 |
|
The members you can define within a
class |
336 |
|
The code for the Product class |
338 |
|
How instantiation works |
340 |
|
|
How to add a class file to a project |
342 |
|
How to code fields |
344 |
|
How to code properties |
346 |
|
How to code methods |
348 |
|
How to code constructors |
350 |
|
How to code static members |
352 |
|
How to use the Class View window |
352 |
|
|
The operation of the Product Maintenance
application |
354 |
|
The classes used by the Product Maintenance
application |
356 |
|
The code for the Product Maintenance
application |
358 |
|
 |
|
|
|
|
© Copyright 1998-
Mike Murach & Associates, Inc. All rights reserved.
|
|
|