mar*_*ner 2 c++ oop methods function
嗨,我正在研究一个代码,并通过这个c ++语法.我想知道这究竟意味着什么.
function1(param1).function2(param2);
Run Code Online (Sandbox Code Playgroud)
这是否代表函数中的函数?或者类似的东西在第一个结束时触发此功能?
function1(param1).function2(param2);
^returns an object ^
|
is a member function of returned object
Run Code Online (Sandbox Code Playgroud)
function1返回一个具有名为的方法的对象function2.
示例function1可能会返回类的实例,如下所示:
class MyClass
{
public:
// ...
void function2( int i ); // the return value and params are just for the example
// ...
};
MyClass function1( Type paramName ); // example of prototype of function1
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
330 次 |
| 最近记录: |