指针 - >调用()和(*指针)之间的区别.Call()

dan*_*jar 2 c++ pointers function call dereference

可能重复:
ptr-> hello();/*VERSUS*/(*ptr).hello();

我正在学习C++,我的问题是如果使用箭头操作符(->)或取消引用指针*来调用函数之间有任何区别.

这两个案例说明了我的问题.

Class* pointer = new Class();
(*pointer).Function();         // case one
pointer->Function();           // case two
Run Code Online (Sandbox Code Playgroud)

有什么不同?

Ola*_*che 6

如果运营商*->不超载,这两个版本完成同样的.