0

What is the meaning of the following inside a header file ClassA.h. Is classB somehow included with the declaration at the top? What is the relationship between classA and classB and how is it different from including header file?

//There is no #include<ClassB.h>

class ClassB; // What does this mean?

class ClassA {
{
// use ClassB in arguments / return types
...
}
user1745995
  • 141
  • 1
  • 7
  • the question of the duplicate is slightly different but the answer also covers forward declaration of a class – 463035818_is_not_an_ai Mar 06 '20 at 20:55
  • It is a declaration of ClassB class. They might define it later somewhere else. This link explains the difference between both in different scenarios (including classes) https://www.cprogramming.com/declare_vs_define.html – Michael Heidelberg Mar 06 '20 at 20:56

0 Answers0