执行输出到文本文件
我正在使用 Visual Studio 2008 编写一个 C 程序。我使用 F7 进行编译,使用 F5 执行该程序。当我按 F5 时,执行窗口包含输出。但我希望将输出保存到文本文件中。如何在视觉工作室中执行此操作。请帮助我。
I am writing a C program using Visual Studio 2008. I use F7 to compile and F5 to execute the program.When I press F5 an execution window contains the output. But I want the output to get saved to a text file. How to do this in visual studio. Please help me someone.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以从命令行运行相同的可执行文件并将其输出重定向到文件,如下所示:
You can run the same executable from the command line and redirect its output to a file as:
我认为使用命令行参数>输出路径就可以了。例如:
将应用程序输出定向到 result.txt 文件。如果从 Visual Studio 中运行应用程序,则可以使用“项目属性 > 调试”配置命令行参数。
I think using the command line parameter >output path will do the trick. for example:
will direct the app output to result.txt file. If you running the application from within Visual Studio, you can configure the command line parameters using "project properties > Debug".