1.system启动exe传参
场景
进程启动进程并传递参数
启动进程代码(cpp)
std::string strTemp = "start C:\\Users\\chengbochen\\source\\repos\\ToRun\\Debug\\Run.exe aaaaaaaaaaaa bbbbbbbbbbb cccccccccccc";
system(strTemp.c_str());
被启动进程代码(cpp)
#include <iostream>
int main(int argv, char* argc[])
{
for (size_t i = 0; i < argv; i++)
{
std::cout << argc[i] << std::endl;
}
std::cout << "\nHello World!";
system("pause");
}
被启动进程执行结果,将启动进程中传递的三个参数依次打印出来