相关疑难解决方法(0)

499
推荐指数
5
解决办法
53万
查看次数

什么是'this'指针?

我是C++的新手,我不明白this指针在以下场景中的作用:

void do_something_to_a_foo(Foo *foo_instance);


void Foo::DoSomething()
{
  do_something_to_a_foo(this);
}
Run Code Online (Sandbox Code Playgroud)

我从别人的帖子里抓住了这个帖子.

有什么this意义?我糊涂了.该函数没有输入,那么在this做什么?

c++ pointers class this

15
推荐指数
2
解决办法
4万
查看次数

标签 统计

c++ ×2

pointers ×2

c ×1

class ×1

dereference ×1

this ×1