dan*_*jar 2 c++ pointers function call dereference
我正在学习C++,我的问题是如果使用箭头操作符(->
)或取消引用指针*
来调用函数之间有任何区别.
这两个案例说明了我的问题.
Class* pointer = new Class();
(*pointer).Function(); // case one
pointer->Function(); // case two
Run Code Online (Sandbox Code Playgroud)
有什么不同?