如何将完整字符串传递给批处理
How do I pass a full string to batch?
我正在编写一个C++程序,它可以让我搜索维基百科、谷歌、Wolfram Alpha等。我通过询问输入(我想用什么搜索,比如"猫的照片")来完成这项工作,然后我将输入传递给批处理,它在批处理中运行一个命令,用我的输入打开谷歌搜索。以下是它的样子:
string input;
cout<<"What do you want to search?"<<endl;
getline(cin, input, 'n');
system(("START https://www.google.com/search?q="+input).c_str());
问题是,如果我让它搜索"有趣的猫",它只搜索"有趣"。我该怎么办?除了使用cmd之外,我还愿意接受其他方法的建议。
Url对搜索字符串进行编码:https://en.wikipedia.org/wiki/Percent-encoding
相关文章:
- 在for循环中使用auto vs decltype(vec.size())来处理字符串的向量
- 是否可以在c++中处理字符串流中的各个元素
- 如何在 SEAL 3.1 中使用 CRT 批处理技术Microsoft?
- 批处理归一化层构造
- 多 GPU 批处理 1D FFT:似乎只有一个 GPU 可以工作
- 如何以这种方式处理字符串数组
- 我们在批处理模式下使用 G++ 时遇到错误
- 如何在 c++ 窗口中将参数和返回的退出值传递到批处理文件/从批处理文件获取返回的退出值
- 从之前添加的批处理文件中删除单词
- 使用qprocess将参数传递给批处理
- 从批处理中提取矩阵,表示为张量
- 无法从C++ Windows 服务执行批处理文件
- 如何将批处理文件的输出读取到C 中的字符串中
- cmake:生成批处理文件调用cl.exe
- 是否可以使用开发控制台使用批处理脚本编译 c++
- 用于批处理分配的库
- 在C /Fortran Interop中处理字符串的官方方法是什么?
- 在调用进程的上下文中通过 win32 执行批处理,从而保留环境变量
- 如何将字符串转换为批处理文件中的整数
- 如何将完整字符串传递给批处理