Why do I need to specify "class" for some component variables?
I was trying to complete this tutorial from the documentation: 1. Creating and Attaching Components
It asks you to create this variable inside your header
Using the former component was compiling OK, but every time I tried to compile with the latter I was getting:
I tried adding the header for
Is there a reason why I should use the
Thank you guys!
asked Jun 09 '19 at 05:09 PM in C++ Programming
It's called forward decleration, it incomplete declares class in hope that in feather code (as #include pastes file in to file) it will fully declare to close off deceleration of class you declering, and it's not just components you should do that with all structures and classes. In UE4 main purpose of this practice is to avoid circular references (header includes header that includes first header) which may produce problems. You can read about here:
Follow this question
Once you sign in you will be able to subscribe for any updates here