C++ equivalent to Java this

后端 未结 3 524
走了就别回头了
走了就别回头了 2020-12-28 15:23

In Java you can refer to the current object by doing: this.x = x. How do you do this in C++?

Assume that each of these code examples are part of a clas

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-28 15:55

    The C++ equivalent is this; that is, the keyword is the same.

提交回复
热议问题