View Single Post
  #2 (permalink)  
Old 06-11-2008, 09:19 AM
v0id's Avatar   
v0id v0id is offline
Retired
 
Join Date: Apr 2007
Location: Denmark
Posts: 2,669
Last Blog:
CherryPy(thon)
Credits: 0
Rep Power: 29
v0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of lightv0id is a glorious beacon of light
Send a message via MSN to v0id
Default Re: C++ Inheritance help!?

A very simple example, showing how "Derived" inherits the functionality from "Base".
Code:
#include <iostream>

class Base
{
    public:
        void basefunction() { std::cout << "In Base" << std::endl; }
};

class Derived : public Base
{
    public:
        void derivedfunction() { std::cout << "In Derived" << std::endl; }
};

int main()
{
    Base b;
    Derived d;
    
    b.basefunction();
    d.basefunction();
    d.derivedfunction();
        
    return 0;
}
I don't know what you mean by that formula, could you be more specific?
__________________
05-03-2007 - 11-13-2008
Reply With Quote