Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在命令提示符下,我可能会编译我的程序,然后按如下方式运行:
myprogram > output.txt
VS2010中是否有类似的重定向输出流的方法?我想在 IDE 中调试/运行我的程序,但有 cout 流到文件。
只需重定向标准输出流指针。
freopen( "file.txt", "w", stdout );