Is some one able to explain why header files have something like this?
class foo; // This here?
class bar
{
bar();
};
Do you need an in
It's a forwards declaration of the class 'foo'. It allows you to declare pointers and references to the class, but not use it (eg. call members or determine its size), because it's not yet defined! It must later be followed up with a full, normal declaration (class foo { ... };
).
It's useful for things like declaring two classes which hold pointers to each other, which otherwise would be impossible to set up.