In case you're missing out on some syntax, a simple example.
Code:
// DerivedBase.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
class Base
{
public:
Base ( );
~Base ( );
int getData ( );
virtual void Print ( ) = 0;
private:
int data;
};
Base::Base ( )
{
data = 10;
}
Base::~Base ( )
{
}
int Base::getData ( )
{
return data;
}
class Derived : public Base
{
public:
Derived ( );
~Derived ( );
void Print ( );
private:
int score;
};
Derived::Derived ( ) : Base ( )
{
score = 30;
}
Derived::~Derived ( )
{
}
void Derived::Print ( )
{
std::cout << "Data value " << getData ( ) << " Score Value " << score << std::endl;
}
int _tmain(int argc, _TCHAR* argv[])
{
Derived derived;
derived.Print ( );
std :: cin.get ( );
}