[英]Debugging with command-line input text in visual studio
I have C++ multi project, in visual studio 2012, from which a .exe file is generated and there is a huge config.txt file contains many input arguments. 我在Visual Studio 2012中有一个C ++多项目,从中生成一个.exe文件,并且有一个巨大的config.txt文件,其中包含许多输入参数。 So I run my program by this command in command line of windows:
program.exe -c config.txt
因此,我通过以下命令在Windows命令行中运行程序:
program.exe -c config.txt
Now I want to debug this program but I can't give it the config.txt as an input argument file. 现在,我想调试该程序,但无法将config.txt作为输入参数文件提供给它。 I tried the answers of Debugging with command-line parameters in Visual Studio
我在Visual Studio中尝试了使用命令行参数进行调试的答案
but it didn't mentioned how to give the whole .txt file to visual studio instead of typing arguments in properties->debugging->command argument 但是它没有提到如何将整个.txt文件提供给Visual Studio,而不是在properties-> debugging-> command参数中键入参数
in config.txt I have arguments like this : 在config.txt中,我有这样的参数:
-numberOfImage 2 ./Lena.jpg ./Barbara.jpg
-imageDimensions 230 230
-minIntensity 0
-maxIntensity 255
and more many inputs which I want to change them easily in .txt file not typing them in command argument. 以及更多我想在.txt文件中轻松更改它们的输入,而不是在命令参数中键入它们。 How can I link config.txt to debugger?
如何将config.txt链接到调试器?
You can: 您可以:
Hardcode the name of the file 硬编码文件名
use the input stream to give another file name 使用输入流提供另一个文件名
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.