本文介绍了如何采取$ C $ 10.05 cblock的命令行参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写在codeblock将版10.05是C code。

I am writing a C code in codeblock version 10.05.

该计划是:

int main(int argc , char *argv[])
{
    printf("Entered number is %s \n", argv[1]);
    return 0;
}

然而,当我编译当前文件,&安培;然后运行该程序,会出现一个终端。但是,终端不等待命令行输入和放大器;它直接输出

However, when i compile current file, & then run the program, a terminal appears. But, the terminal doesn't wait for command line input & it directly outputs

<null>

请注意,在上面的程序,我省略了code办理零号的命令行参数。
我怎样才能提供的命令行参数?

Note that in the above program, i have omitted the code for handling zero number of command line arguments.How can i supply command line arguments?

推荐答案

使用code ::块,您可以设置您的命令行参数这样的菜单:

With code::blocks you can set your command line arguments like this in the menu:

项目&GT;一套方案的论据...

这将打开一个窗口,您可以将您的参数。

This opens a window where you can insert your parameters.

这篇关于如何采取$ C $ 10.05 cblock的命令行参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 16:12