I feel so lost with this C++ code. I feel like I don’t have enough of the basics. I do pretty much anything, including reading a boring C++ book. Any tips on reviewing, or any other resources that I should be looking at?
Thanks.
I feel so lost with this C++ code. I feel like I don’t have enough of the basics. I do pretty much anything, including reading a boring C++ book. Any tips on reviewing, or any other resources that I should be looking at?
Thanks.
I would say just stick with it.
If you can let go of understanding everything, you can learn by doing, and the rate of learning can be exponential. Each “aha!” moment opens you up to others. You might find that, by the end of section 4, the boring C++ book makes a lot more sense.
Also, keep in mind that you’re not just learning C++. You’re learning how to interface with the Unreal Engine and the Unreal Editor. That’s a lot to learn all at once, so a bit of “feeling lost” makes sense.
Finally, you can bring specific “lost moments” to the forum, asking about one particular thing that you didn’t get in a lecture (e.g. “Why was there a * in front of GetName() when it’s already a pointer?”)
Thank you! I’ll listen to your advice. I actually had to go through the BullCowGame a couple of times to get it XD .
A couple of things that I have had issue with are the pointers/references and when to use the -> and the ‘.’. Also when to use the (). Any tips?
Also what “auto” means. I really don’t get that . Thank you for your time!
auto
is a shortcut. It saves you having to specify the correct type when declaring and defining a variable by letting the compiler figure it out for you. I always forget about it and fully declare the type because I first started using c++ in the dark ages.
When to use parenthesis covers a lot of different areas that are pretty core to programming but in this context I think you are talking about calling methods/functions. The () on something like
Object.DoSomething()
or ObjectPointer->DoSomething()
says DoSomething is a function and not a simple variable and that the program is to go and run that function. In other words DoSomething is a method that is a member of the Object class and you are calling that method.
The “.” and “->” are member operators and are used to access the members of a class (or struct). You use the “.” when dealing directly with an object, and you use the “->” when accessing the same members through a pointer to the object. Check out this link… it talks about data structures and accessing their members using the operators you are wondering about: http://www.cplusplus.com/doc/tutorial/structures/
Thank you so much, you answered all of my questions!
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.