MarkdownPad Document

*:first-child {
margin-top: 0 !important;
}

body>*:last-child {
margin-bottom: 0 !important;
}

/* BLOCKS
=============================================================================*/

p, blockquote, ul, ol, dl, table, pre {
margin: 15px 0;
}

/* HEADERS
=============================================================================*/

h1, h2, h3, h4, h5, h6 {
margin: 20px 0 10px;
padding: 0;
font-weight: bold;
-webkit-font-smoothing: antialiased;
}

h1 tt, h1 code, h2 tt, h2 code, h3 tt, h3 code, h4 tt, h4 code, h5 tt, h5 code, h6 tt, h6 code {
font-size: inherit;
}

h1 {
font-size: 28px;
color: #000;
}

h2 {
font-size: 24px;
border-bottom: 1px solid #ccc;
color: #000;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777;
font-size: 14px;
}

body>h2:first-child, body>h1:first-child, body>h1:first-child+h2, body>h3:first-child, body>h4:first-child, body>h5:first-child, body>h6:first-child {
margin-top: 0;
padding-top: 0;
}

a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 {
margin-top: 0;
padding-top: 0;
}

h1+p, h2+p, h3+p, h4+p, h5+p, h6+p {
margin-top: 10px;
}

/* LINKS
=============================================================================*/

a {
color: #4183C4;
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

/* LISTS
=============================================================================*/

ul, ol {
padding-left: 30px;
}

ul li > :first-child,
ol li > :first-child,
ul li ul:first-of-type,
ol li ol:first-of-type,
ul li ol:first-of-type,
ol li ul:first-of-type {
margin-top: 0px;
}

ul ul, ul ol, ol ol, ol ul {
margin-bottom: 0;
}

dl {
padding: 0;
}

dl dt {
font-size: 14px;
font-weight: bold;
font-style: italic;
padding: 0;
margin: 15px 0 5px;
}

dl dt:first-child {
padding: 0;
}

dl dt>:first-child {
margin-top: 0px;
}

dl dt>:last-child {
margin-bottom: 0px;
}

dl dd {
margin: 0 0 15px;
padding: 0 15px;
}

dl dd>:first-child {
margin-top: 0px;
}

dl dd>:last-child {
margin-bottom: 0px;
}

/* CODE
=============================================================================*/

pre, code, tt {
font-size: 12px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
}

code, tt {
margin: 0 0px;
padding: 0px 0px;
white-space: nowrap;
border: 1px solid #eaeaea;
background-color: #f8f8f8;
border-radius: 3px;
}

pre>code {
margin: 0;
padding: 0;
white-space: pre;
border: none;
background: transparent;
}

pre {
background-color: #f8f8f8;
border: 1px solid #ccc;
font-size: 13px;
line-height: 19px;
overflow: auto;
padding: 6px 10px;
border-radius: 3px;
}

pre code, pre tt {
background-color: transparent;
border: none;
}

kbd {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background-color: #DDDDDD;
background-image: linear-gradient(#F1F1F1, #DDDDDD);
background-repeat: repeat-x;
border-color: #DDDDDD #CCCCCC #CCCCCC #DDDDDD;
border-image: none;
border-radius: 2px 2px 2px 2px;
border-style: solid;
border-width: 1px;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 10px;
padding: 1px 4px;
}

/* QUOTES
=============================================================================*/

blockquote {
border-left: 4px solid #DDD;
padding: 0 15px;
color: #777;
}

blockquote>:first-child {
margin-top: 0px;
}

blockquote>:last-child {
margin-bottom: 0px;
}

/* HORIZONTAL RULES
=============================================================================*/

hr {
clear: both;
margin: 15px 0;
height: 0px;
overflow: hidden;
border: none;
background: transparent;
border-bottom: 4px solid #ddd;
padding: 0;
}

/* TABLES
=============================================================================*/

table th {
font-weight: bold;
}

table th, table td {
border: 1px solid #ccc;
padding: 6px 13px;
}

table tr {
border-top: 1px solid #ccc;
background-color: #fff;
}

table tr:nth-child(2n) {
background-color: #f8f8f8;
}

/* IMAGES
=============================================================================*/

img {
max-width: 100%
}
-->

LinuxC下argc,argv[ ]的意义

参考了http://blog.csdn.net/followingturing/article/details/7707584

还是根据实例来进行说明:

 #include<stdio.h>
#include<stdlib.h> int main(int argc,char *argv[])
{
if(argc== || argc>)
{
printf("Please input the name of the file
you want to edit, for example:./edit fillen\n");
printf("argv[0] is %s\n",argv[]);
} if(argc==)
{
printf("Now EDIT %s\n",argv[]);
printf("argv[0] is %s\n",argv[]);
printf("argv[1] is %s\n",argv[]);
} exit();
}
  • 通过gcc生成可执行文件edit如下:
  • 运行文件edit:./edit,如下:
  • 运行文件edit,并输入file.txt: ./edit file.txt,如下:

结论:

  1. argc 为外部命令参数的个数,因此

    输入命令./edit时,argc==1;
    输入命令./edit file.txt时,argc==2;

  2. argv[]为存储的命令,其中argv[0]即为可执行文件名;

    输入命令./edit时,argv[0]=="./edit";
    输入命令./edit file.txt时,argv[0]=="./edit",argv[1]=="file.txt";

2017-2-4 23:10;20

LinuxC下argv,argc[]的意义的更多相关文章

  1. 通过实例解释LinuxC下argc,argc[]的意义

    MarkdownPad Document html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,ab ...

  2. linux 下各errno的意义(转)

    linux 下各errno的意义(转)   本文转自:http://blog.csdn.net/kofiory/article/details/5790409 strerror(errno):获取er ...

  3. linux 下信号处理命令trap && linux下各种信号的意义

    1.用途说明 trap是一个shell内建命令,它用来在脚本中指定信号如何处理.比如,按Ctrl+C会使脚本终止执行,实际上系统发送了SIGINT信号给脚本进程,SIGINT信号的默认处理方式就是退出 ...

  4. Linuxc - C语言下return 0的意义

    两条指令同时执行,前提是第一条指令返回0.否则不执行第二条指令. root@jiqing-virtual-machine:~/cspace/les3# gcc main.c -o main.out & ...

  5. '假定以下程序经编译和连接后生成可执行文件PROG.EXE,如果在此可执行文件所在目录的DOS提示符下键入:PROG ABCDEFGH IJKL<回车>,则输出结果为( ). void main( int argc, char *argv[]) { while(--argc>0) cout<<argv[argc]; cout<<"\n"; }

    main(int argc,char *argv[])函数的两个形参,第一个int argc,是记录你输入在命令行(你题目中说的操作就是命令行输入)上的字符串个数:第二个*argv[]是个指针数组,存 ...

  6. LinuxC下获取UDP包中的路由目的IP地址和头标识目的地址

    在接受到UDP包后,有时候我们需要根据所接收到得UDP包,获取它的路由目的IP地址和头标识目的地址. (一)主要的步骤: 在setsockopt中设置IP_PKTINFO,然后通过recvmsg来获取 ...

  7. linux 下各errno的意义

    strerror(errno):获取errno对应的错误 #include <string.h> /* for strerror */ #include <errno.h> # ...

  8. Liniux系统下目录的权限意义

    访问者及其基本权限 Linux系统内的文件访问者有三种身份,分别是: a) 文件和文件目录的所有者: u---User(所有权);b) 文件和文件目录的所有者所在的组的用户: g---Group;c) ...

  9. Linux系统下目录的权限意义

    访问者及其基本权限 Linux系统内的文件访问者有三种身份,分别是: a) 文件和文件目录的所有者: u---User(所有权);b) 文件和文件目录的所有者所在的组的用户: g---Group;c) ...

随机推荐

  1. 跨域 node git

    promise 异步回调地狱:就是多个异步请求嵌套的表现 瑕疵:后期维护难 解决:通过promise技术 什么是promise:就是一种异步编程的解决方案 有三个状态:进行中.成功了,失败了 var ...

  2. 55.ORM外键:引用同app下的不同模型,引用不同app下的模型,引用模型自身使用详解

    外键和表关系 外键是属于数据库级别的,在MySQL中,表有两种引擎,一种是InnoDB,另外一种是myisam.如果使用的是InnoDB引擎,是支持外键约束的.外键的存在使得ORM框架在处理表关系的时 ...

  3. C# Timer 控件的用法

    一.主要的属性 在 Windows 窗体应用程序中,定时器控件(Timer)与其他的控件略有不同,它并不直接显示在窗体上,而是与其他控件连用. Enabled 属性: 用于设置该Timer控件是否可用 ...

  4. hashlib加密模块_python

    一.hashlib模块 1.功能 主要用于字符串加密 2.常用方法 md5()/sha1():创建一个md5或者sha1加密模式的hash对象update(arg):用字符串参数来更新hash对象,如 ...

  5. 实用 docker history

    关闭安装认证, 开启tcp 端口 sudo vi /usr/lib/systemd/system/docker.service ExecStart=/usr/bin/dockerd --insecur ...

  6. guava的简单使用

    引入依赖 <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId ...

  7. Codeforces Round #570 (Div. 3) B. Equalize Prices

    原文链接https://codeforces.com/contest/1183/problem/B 题意:进行Q组测试,在每组中有长度为n的数组a[i],然后现在给你一个K,问你找到一个bi使得|ai ...

  8. centOS7中启动MySQL数据库提示: Failed to start mysqld.service: Unit not foundc

    现象: 在centOS7中启动MySQL数据库提示: Failed to start mysqld.service: Unit not found [明明已经安装了,为什么提示不存在呢?] 原因: 在 ...

  9. Adobe 系列下载链接

    (注意!:在下方链接前加上 "pan.baidu.com/s/" 才是正确网址,用"百度网盘"下载) Photoshop 专区(图像处理软件) Adobe Ph ...

  10. Hadoop TextInputFormat

    1. TextInputFortmat TextInputFormat是默认的InputFormat.每条记录是一行输入.Key是LongWritable类型,存储该行在整个文件中的字节偏移量(不是行 ...