How to set up your own classes of objects in
C++, and how to use those objects and also objects
that are available to you from elsewhwere. We also
introduce access levels in this module.
This topic is presented on public courses
C++ for C Programmers,
C and C++ Programming
Examples from our training material
| a2.cpp | Array of objects of different types |
| a3.cpp | Interited methods - test program |
| afuncs.cpp | Class use with accessor functions |
| allin1.cpp | Class definition and use all in one file |
| book.cpp | Class implementation code - book |
| book.inc | Class interface - book |
| demo1.cpp | Base clase and subclass method definition |
| demo1.h | Base clase and subclass header definition |
| demo2.cpp | Further base and subclass definition |
| demo2.h | Further base and subclass header definition |
| demomake | makefile for module c232 |
| hcd.cpp | Class description with accessor functions |
| hmain.cpp | First class in C++ |
| hotel.cpp | Class member code |
| hotel.inc | Class descriptor |
| makefile | Compile / Load instructions for examples in this module |
| melksham.cpp | Class use with accessor functions |
| mylib.cpp | Main application calling constructors and destructors |
Background information
Some modules are
available for download as a sample of our material or under an
Open Training Notes License for free download from
http://www.training-notes.co.uk.
Topics covered in this module
Defining classes through struct and class.
Member functions.
Constructors and Destructors.
Private, Protected and Public.
Exercise.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our
Listing and schedule page.
Well House Consultants specialise in training courses in
Python,
Perl,
PHP, and
MySQL. We run
Private Courses throughout the UK (and beyond for longer courses), and
Public Courses at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if
you live in a different
country or continent to us.
We have a technical library of over 600 books on the subjects on which we teach.
These books are available for reference at our training centre. Also
available is the Opentalk
Forum for discussion of technical questions.