gpt4 book ai didi

c++ - C++ 中的系统调用打开一个新终端。 window

转载 作者:行者123 更新时间:2023-11-28 04:50:29 24 4
gpt4 key购买 nike

<分区>

我正在尝试使用 c++ 中的系统命令。

std::string cmd = " DIR > d:\a.txt" ; 
int isystemOut2 = system (cmd.c_str());

当我运行它时,我看到 d:\a.txt 有正确的输出,但我看到命令提示符立即打开和关闭。有没有办法阻止打开新的命令提示符。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com