C++ 中箭头操作符(->)和点操作符(.)的不同

针对 -> 和 . 的定义区别如下:

如果 p 是指针,p -> function();

如果 p 是对象和结构体,p.function();

例如:


related post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.