問題描述
我正在 Visual Studio 中開發 C++ 命令行應用程序,需要使用命令行參數對其進行調試.目前我只是使用我需要的參數運行生成的 EXE 文件(比如這個 program.exe -file.txt
),但這樣我無法調試.有什么地方可以指定調試參數嗎?
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?
推薦答案
是的,它在項目屬性頁的調試部分.
Yes, it's in the Debugging section of the properties page of the project.
自 2008 年起在 Visual Studio 中:右鍵單擊 項目,選擇 屬性,轉到 調試 部分——有一個命令參數"框.(提示:不是解決方案,而是項目).
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).
這篇關于在 Visual Studio 中使用命令行參數進行調試的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!