When forward declarations of functions work in a source file (.cpp), why would the same doesn\'t work for classes ?
Thanks.
// main.cpp
void forwar
Place your member declaration of your class before the member implementations.
class One {
public:
void anyAccess() ;
static int statVar ;
private:
int classVar ;
} ;
int One:: statVar = 10 ;
void
One :: anyAccess() {
std::cout << "\n statVar:\t " << statVar ;
std::cout << "\n classVar:\t" << classVar ;
}