Training, Open Source computer languages

PerlPHPPythonMySQLhttpd / TomcatTclRubyJavaC and C++LinuxCSS

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Tips and short articles on this subject
What a lot of files! (C++ / Polymorphism demo)
C - structs and unions, C++ classes and polymorphism
What are factory and singleton classes?
C++ - just beyond the basics. More you can do
Comparison of Object Oriented Philosophy - Python, Java, C++, Perl
Simple polymorphism example - C++
References and Pointers in C++
Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
OO in C++ - beyond the basics - C and C based languages module C233
If you want to define one object that's similar (but not identical) in structure and behaviour to another, you do so through inheritance. If you then have an array of similar objects, you can have C++ decide which particular behavious to use on each element in turn and this is known as polymorphism. In C++, you can define a type of object that inherits its behaviour from seveal others if you wish, and you can group toghether a whole lot of similar types of objects into modules - both of these are more advanced facilities that we cover in this module.

This topic is presented on public courses C++ for C Programmers, C and C++ Programming

Examples from our training material
accom2.cpp   Class storing strings within an object
accom3.cpp   An array of objects
accom4.cpp   An array of objects
accomchooser.cpp   Class using classes and derived classes with inheritance
beasts.cpp   Definition of polymorphic class methods
beasts.h   Definition of polymorphic class headers
hotel.cpp   Class member code
hotel.inc   Class descriptor
loader   Complete first Polymorphism example
makefile   Compile / Load instructions for examples in this module
melkshamhotel.cpp   Derived class member code
melkshamhotel.inc   include file to define melkshamhotel
regionhotel.cpp   Derived class member code
regionhotel.inc   include file to define region hotel
testh.cpp   First denmo of polymorphism
testh2.cpp   Demo of polymorphism across an array
tinin.cpp   base class, extended class, test code
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
Deriving one class from another - Inheritance.
Inheritance and access control.
Packaging classes into modules.
Extending Classes.
Multiple inheritance.
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.


© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho