博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
int main(int argc,char* argv[])详解
阅读量:4284 次
发布时间:2019-05-27

本文共 255 字,大约阅读时间需要 1 分钟。

argc是命令行总的参数个数;

argv[]是argc个参数,其中第argv[0]是程序的全名,以后的参数是命令行后面跟的用户输入的参数,比如:

void main(int argc,char *argv[]){    printf("%d\n",argc);    printf("%s\n",argv[0]);    printf("%s\n",argv[1]);    printf("%s\n",argv[2]);}

执行时敲入:./test abc defg

程序输出:

3./testabcdefg

转载地址:http://mqigi.baihongyu.com/

你可能感兴趣的文章
Git 基礎 - 檢視提交的歷史記錄
查看>>
wifi 連ap command
查看>>
git clean reset checkout
查看>>
[轉載]6個超強網站讓你查到最道地的英文
查看>>
HUB 與 Switch 差別
查看>>
linux產生 core dump文件方法及設置
查看>>
How to pass macro definition from “makefile” command line arguments to C source code?
查看>>
英文句型
查看>>
mtd and /dev/mtd*相關資料
查看>>
cp: cannot create symbolic link to fat format of usb: Operation not permitted
查看>>
MTD bad Block issue
查看>>
How to change network interface name
查看>>
ubifs and ubi and mtd
查看>>
shell script set 用法
查看>>
英文序數寫法與唸法 Ordinal Numbers(轉載)
查看>>
DVB-S info
查看>>
绿盟扫描操作指导
查看>>
理解链路本地址与站点本地地址
查看>>
/proc/mtd 各个参数含义 -- linux内核
查看>>
linux nand flash常用命令
查看>>