如何在 Visual C++ 6.0 中使用命令行参数运行控制台应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/276543/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to run a console application with command line parameters in Visual C++ 6.0?
提问by Rob Kam
I've got a console application that compiles and executes fine with Visual C++ 6.0, except that it will then only get as far as telling me about missing command line parameters. There doesn't seem to be anywhere obvious to enter these. How do I run or debug it with command line parameters?
我有一个控制台应用程序,它可以用 Visual C++ 6.0 编译和执行,但它只会告诉我有关缺少命令行参数的信息。似乎没有任何明显的地方可以输入这些。如何使用命令行参数运行或调试它?
回答by Michael Burr
I assume you're talking about setting the command line parameters for running in the IDE.
我假设您正在谈论设置用于在 IDE 中运行的命令行参数。
Open the Project/Settings property page and go to the Debug tab.
打开 Project/Settings 属性页并转到 Debug 选项卡。
There's a "Program arguments" field you can put them into.
您可以将它们放入一个“程序参数”字段。
回答by Greg Hewgill
If I remember correctly, under Project/Settings/Debug tab there is a place to enter the command line parameters. It's the "Program arguments" field.
如果我没记错的话,在项目/设置/调试选项卡下有一个输入命令行参数的地方。这是“程序参数”字段。
回答by Ganesh
In VS2010: Right click the project. Select Properties. Select Debug tab. Start Options -> Command line arguments: Enter the arguments here.
在 VS2010 中:右键单击项目。选择属性。选择调试选项卡。开始选项 -> 命令行参数:在此处输入参数。