I'm not 100% on how the compiler reads header files, so I wanted to know why this gives a compiler error and doesn't work:
#ifndef FOO_H
#define FOO_H
#include "central.h"
class Foo
{
Oof var;
}
#endif
#ifndef OOF_H
#define OOF_H
#include "central.h"
class Oof {}
#ifndef CENTRAL_H
#define CENTRAL_H
#include "foo.h"
#include "oof.h"
When compiled it gives the error that "oof does not name a type." My best guess is that it's because they continue including each other?
Other than that, is just doing #include "oof.h"
in Foo the only/best way to do what I'm trying to do here?