C++如何将变量传递到函数中
C++ how to pass variable into function?
void webparser()
{
stringstream ss;
ss << "lynx -dump 'http://somesite.com/q?s=" << currency << "=X' > file.txt";
system(ss.str().c_str());
}
如果我想将 GBPUSD 用作 char chArray[],如何将例如"GBPUSD"传递到网络解析器中;然后在我的情况下将传递的值分配为可变货币
谢谢,不需要退货。
void webparser(const std::string& currency) {
stringstream ss;
ss << "lynx -dump 'http://somesite.com/q?s=" << currency << "=X' > file.txt";
system(ss.str().c_str());
}
调用函数:
webparser("Hello, World!");
相关文章:
- 未使用的C++未优化的静态成员函数/变量
- 内联函数/变量的外部链接
- 同一函数中的静态函数变量初始化顺序
- 将非静态成员函数C 的使用无效,而将成员功能作为函数变量
- 如何从doxygen输出中排除类的无证件成员函数/变量
- 如何在LUA C API中分配全局LUA函数变量
- 如何将函数变量传递给C lambda函数
- 通过另一个C++函数更改函数变量
- c++11 lambda 真的支持闭包吗?函数变量中存在语义冲突
- C++:静态成员不能在声明时定义,但静态函数变量可以?
- apache-frift是否支持函数变量作为参数
- 类函数/变量在使用之前必须声明
- 函数变量去哪里
- 无法使用函数变量?错误表达式必须具有类类型
- 如何在main中使用函数变量
- 每当尝试打印函数变量时,C++ cout 错误
- 是否存在查看成员函数/变量的整洁等效项
- 访问友元类之间的函数变量
- 函数到函数变量
- 一个定义规则是否强制创建一个静态函数变量