Friday, July 5, 2013

C++ fundamentals

In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, or parent classes. The resulting classes are known as derived classes, subclasses, or child classes.

class SuperClass

SuperClass(int foo)
// do something with foo

class SubClass : public SuperClass

SubClass(int foo, int bar):SuperClass(foo) // Call the superclass constructor in the subclass' initialization list.
// do something with bar

Virtual Inheritance

Abstract Classes

Friend Classes

Explicit Constructors

Virtual Methods

Pure Virtual Methods


Static Methods


Initialization List


Function Overriding

Function Pointer

Pass by Value, Pass by Reference, Pass by Pointer

No comments:

Post a Comment