# 重载->运算符

如果我们有一个类的对象，那么我们可以使用成员访问操作符`.` 来访问其成员变量和成员函数，例如：

```cpp
MyClass obj;
obj.memberVariable = 10;   // 访问成员变量
obj.memberFunction();      // 调用成员函数
```

如果我们有一个指向类对象的指针，可以使用箭头操作符 `->` 来访问其成员变量和成员函数，例如：

```cpp
MyClass *ptr = new MyClass();
ptr->memberVariable = 10;    // 访问成员变量
ptr->memberFunction();       // 调用成员函数
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tysun.gitbook.io/c++/zhong-zai-yun-suan-fu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
