What is the benefit of using a pointer C++
This question already has an answer here:
There is no "simulation" happening at all. book1
has an address too, and the this
pointer is set to the address of book1
when you do book1.setBooksId(123);
. There is no difference.
上一篇: 哪个更好:存储对象vs存储指针?
下一篇: 使用指针C ++有什么好处