I was wondering if there is a way to inherit from a class in a completely different cpp file?
Any help would be great!
I was wondering if there is a way to inherit from a class in a completely different cpp file?
Any help would be great!
Yep, you can. I forget the exact syntax of it, but I think you either have to declare extern before the class in the other cpp or do nothing. You definately should check the syntax because using multiple files is not my specialty. (aka: I suck at it )
classA.h:
class A
{
}
classA.cpp:
A::A(void)
{}
classB.h:
#include "classA.h"
class B : public A
{
}
hope this helps!
U.
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.