Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: this ->  (Read 679 times)

0 Members and 1 Guest are viewing this topic.

henrybuckets11

  • Newbie
  • *
  • Posts: 1
    • View Profile
    • Email
this ->
« on: February 24, 2023, 01:11:39 am »
When I am watching tutorials on youtube or looking at other people's code, I see the command
 this->
and then something after, maybe a variable or something else. Could someone please explain to me what it does or what it means.
« Last Edit: February 24, 2023, 01:48:17 am by henrybuckets11 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10838
    • View Profile
    • development blog
    • Email
Re: this ->
« Reply #1 on: February 24, 2023, 07:13:06 am »
That's some basic C++ knowledge, which you should find an answer to with a simple web search for "c++ this".

See for example: https://en.cppreference.com/w/cpp/language/this

It's a pointer to the current class
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything