foo(string & str){}
调用:
foo(string("hi"));//正确
string 作为函数实参
C++ 函数示例
最新推荐文章于 2021-06-02 17:10:16 发布
本文展示了一个简单的 C++ 函数 foo 的定义及调用方式,该函数接受一个字符串引用作为参数。
C++ 函数示例
本文展示了一个简单的 C++ 函数 foo 的定义及调用方式,该函数接受一个字符串引用作为参数。
foo(string & str){}
调用:
foo(string("hi"));//正确
378

被折叠的 条评论
为什么被折叠?