Download

Learned c++ a couple of questions.

I learned c++ by reading more then half of the practice the c++ . I’m able to read the documentation fairly well. I have a few questions. One I know about templates. But when I see a documentation that states.

RootComponent = CreateDefaultSubobject<USceneComponent>(TEXT(“RootComponent”));

Where would I find what createdefaultsubobject do? Are types like these considered all storage containers not sure? but as far as its creating a instance of uscenecomponent maybe? So far that’s the only sang I hit. Also is watching the live stream training videos worth it? And if i should prepare myself some more which books or topics should i read?

Actually so far I’m able to read everything well except something like that example. I know it’s some type of user defined template but any books someone can refer to explain in full? better yes if anyone has a learning book set to follow let me know.But when I look at the code it’s fairly easy if I was looking at a vector<int> i… I would know It’ll make a vector which that takes the int… and stores the data… Matter of fact when If i think about vector must be a class with function that says store data and uses push back() member of the class… that takes another class or and gives it a name. But it’ll be much better to read a book to have a easier understand.

Goto https://docs.unrealengine.com/latest/INT/ and type “CreateDefaultSubobject” in the big blue box that says “Need help?” Usually the first link of the results points to the API docs and the remainder to other posts mentioning it on answerhub, the forum or in the API docs.

CreateDefaultSubobject is a function template. The <USceneComponent> constrains the template to the type USceneComponent and the (TEXT(“RootComponent”)) specifies one parameter, a constant string “RootComponent”.

Since you’re still pretty new to C++, watch the C++ coding examples is worth your time to see how C++ is applied to solving problems.

The site I link to above: http://en.cppreference.com is one I still use on a regular basis (and I’ve been programming C++ for a long time).