Man*_*oon 25 c++ debugging command-line netbeans
如何为netbeans C++项目指定命令行参数?
调试选项卡上似乎没有合适的位置.
fab*_*s88 26
要在netbeans中为C++项目指定命令行参数,请转到:
Project properties
=> Run
=>Run Command
默认为:
"${OUTPUT_PATH}"
改为:
"${OUTPUT_PATH}" hi 5
使用以下代码创建main.cpp:
int main(int argc, char** argv) {
cout << "First argument: " << argv[1] << endl;
cout << "Second argument: " << argv[2] << endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
产生输出:
First argument: hi
Second argument: 5
RUN SUCCESSFUL (total time: 320ms)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
20402 次 |
最近记录: |