calling class name in the header file
c++
Solution
This is called a forward declaration. It means that there IS a class named CFoo, that will be defined later in the file (or another include). This is typically used for pointer members in classes, such as:
class CFoo;
class CBar {
public:
CFoo* object;
};
It is a hint to the C++ compiler telling it not to freak out that a type name is being used without being defined, even though it hasn't seen the full definition for CFoo yet.
Problem
I just stumbled a c++ code with a calling of a class name in the upper part of the header file for example ``` class CFoo; class CBar { .... }; ``` My question is, what is `class CFoo` for? Thanks alot!