请提供一个解释示例.
c c++ pointers dereference
我是C++的新手,我不明白this指针在以下场景中的作用:
this
void do_something_to_a_foo(Foo *foo_instance); void Foo::DoSomething() { do_something_to_a_foo(this); }
我从别人的帖子里抓住了这个帖子.
有什么this意义?我糊涂了.该函数没有输入,那么在this做什么?
c++ pointers class this
c++ ×2
pointers ×2
c ×1
class ×1
dereference ×1
this ×1