执行输出到文本文件 [英] Execution output to text file

查看:50
本文介绍了执行输出到文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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.

推荐答案

我认为使用命令行参数 >输出路径 可以解决问题.例如:

I think using the command line parameter >output path will do the trick. for example:

myapp.exe >D:\result.txt

将应用程序输出定向到 result.txt 文件.如果您从 Visual Studio 中运行应用程序,则可以使用项目属性 > 调试"配置命令行参数.

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".

这篇关于执行输出到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆