Use this as an example:
base class

#ifndef BASE_H
#define BASE_H

class Base
    int foo;

    Base(int number) : foo(number) {}


derived class

#ifndef DERIVED_H  //<- inclusion gaurding
#define DERIVED_H

#include "base.h"  //<- this adds the code from base.h to derived.h

class Derived : public Base
    int foobar;
    Derived(int num1, int num2) : Base(num1), foobar(num2) {}


This is how your headers would look. Then in the .cpp files you would just need to include the .h that the .cpp file is named after.

base class .cpp file

#include "base.h"

// all the code for the base class would go here

derived class .cpp file

#include "derived.cpp"

// all the code for the derived class would go here.

Edited 3 Years Ago by NathanOliver

This question has already been answered. Start a new discussion instead.