問(wèn)題描述
我正在 Visual Studio 中開(kāi)發(fā) C++ 命令行應(yīng)用程序,需要使用命令行參數(shù)對(duì)其進(jìn)行調(diào)試.目前我只是使用我需要的參數(shù)運(yùn)行生成的 EXE 文件(比如這個(gè) program.exe -file.txt
),但這樣我無(wú)法調(diào)試.有什么地方可以指定調(diào)試參數(shù)嗎?
I'm developing a C++ command-line application in Visual Studio and need to debug it with command-line arguments. At the moment I just run the generated EXE file with the arguments I need (like this program.exe -file.txt
) , but this way I can't debug. Is there somewhere I can specify the arguments for debugging?
推薦答案
是的,它在項(xiàng)目屬性頁(yè)的調(diào)試部分.
Yes, it's in the Debugging section of the properties page of the project.
自 2008 年起在 Visual Studio 中:右鍵單擊 項(xiàng)目,選擇 屬性,轉(zhuǎn)到 調(diào)試 部分——有一個(gè)命令參數(shù)"框.(提示:不是解決方案,而是項(xiàng)目).
In Visual Studio since 2008: right-click the project, choose Properties, go to the Debugging section -- there is a box for "Command Arguments". (Tip: not solution, but project).
這篇關(guān)于在 Visual Studio 中使用命令行參數(shù)進(jìn)行調(diào)試的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!