I understand why this doesn't work as the subclass isn't a forward reference, but is something along these lines with the same theoretical functionality possible?.
This is the implementation I'd use if I could forward reference the subclass array:
class_declare.h:
class parentClass{
int i;
}childClass[100];
someSource0.cpp:
include "class_declare.h"
//manipulate values of the array - but can this refer to one that is forward declared
//and not a new object?
void dosomething(){
childclass[1]=10;
}
someSource1.cpp:
include "class_declare.h"
void dosomethingelse(){
std::cout<<childclass[1];
}
Output:
10
Thank you!.