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
{
public:

SuperClass(int foo)
{
// do something with foo
}
};

class SubClass : public SuperClass
{
public:

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
http://weblogs.asp.net/kennykerr/archive/2004/08/31/Explicit-Constructors.aspx

Virtual Methods

Pure Virtual Methods

Singleton

Static Methods

Templates

Initialization List

Namespace

Function Overriding

Function Pointer

Pass by Value, Pass by Reference, Pass by Pointer

No comments:

Post a Comment