0

the other day I was searching on github and I came across this game named Pioneer, on file pi.h I noticed a lot of "class X;" statements (where X is "Galaxy","Intro", etc.) here you can see the code. what is it for? and is it good practice? I supossed it has a simple explanation but I could not find anything on the web.

user1006274
  • 273
  • 2
  • 8

1 Answers1

2

It is called a forward declaration to introduce a type which is being used later on. Without it the compiler doesn't recognize the type and has no clue what to do with it.

zxcdw
  • 1,629
  • 1
  • 10
  • 18