lundi 27 mai 2019

How is this pointer different than accessing variables directly [duplicate]

This question already has an answer here:

Why and where should I use this pointer, when I can access the variables and functions of the object directly?

Like in the following code.

SpriteRenderer::SpriteRenderer(const Shader &shader)
  {
   this->Myshader = shader;  // I can also do Myshader = shader;
   this->InitRenderData();   // I can also do InitRenderData();
  }

Aucun commentaire:

Enregistrer un commentaire