主函数

int main(int argc,char * argv[]) -- arg代表英文的参数缩写 c代表count计数 argc

{

  return 0;  -- 0返还给系统,代表程序正确运行

}

int i;

for(i=0;i<argc;i++)

{

printf("%s\n",argv[i]);

}

./a.out 123 678 opq

结果 123 678 opq

求两个数的和,最小值

t1.h
int add(int a,int b); t2.h
int min(int a,int b); add.c
#include"t1.h"
int add(int a, int b)
{
ruturn (a+b);
} min.c
#include"t2.h"
int min(int a ,int b)
{
return (a-b);
} main.c
#include<stdio.h>
#include"t1.h"
#include"t2.h"
main()
{
int x= ;
int y=;
printf("%d\n",add(x,y));
printf("%d\n",min(x,y));
} makefile 文件
main: main.o add.o min.o
   gcc -o main main.o add.o min.o
main.o: main.c add.c min.c
     gcc -c main.c
add.o: add.c t1.h
    gcc -c add.c
min.o: min.c t2.h
    gcc -c min.c

实现 cp 功能 x代替 cp x test.c test1.c

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(int argc,char *argv[])
{
FILE *in,*out;
char ch;
int i,k;
if(argc<)
{
printf("please input\n");
}
else {
if((in=fopen(argv[],"rb"))==NULL) {
printf(can not open);
exit();
}
}
if((out=fopen(argv[]),"wb")==NULL) {
printf("can not open");
exit();
}
ch=fgetc(in);
while(feof(in)==) {
fputc(ch,out);
ch=fgetc(in);
}
fclose(in);
fclose(out);
return ;
}

简单的c语言小程序 回光返照的更多相关文章

  1. 通过反汇编C语言小程序学习Liunx汇编语言

    大家好!    我是来自山东师范大学的吴乐.    今天在<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 ...

  2. Linux下简单C语言小程序的反汇编分析

    韩洋原创作品转载请注明出处<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 写在开始,本文为因为参加MOO ...

  3. c语言小程序以及java生成注释文档方法

    c语言小程序:sizeof和strlen() sizeof运算符以字节为单位给出数据的大小,strlen()函数以字符为单位给出字符串的长度,字符和字节不是一回事. char类型用于存储字母和标点符号 ...

  4. C语言小程序——推箱子(窄字符和宽字符)

    C语言小程序——推箱子(窄字符Version) 推箱子.c #include <stdio.h> #include <conio.h> #include <stdlib. ...

  5. Linux C语言小程序

    Linux C语言小程序 #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include & ...

  6. Netty学习——基于netty实现简单的客户端聊天小程序

    Netty学习——基于netty实现简单的客户端聊天小程序 效果图,聊天程序展示 (TCP编程实现) 后端代码: package com.dawa.netty.chatexample; import ...

  7. Winfrom 简单的进度条小程序

    使用Winform空间编写简单的进度条小程序: 所需控件:Lable 标签  TextBox  文本框  progressBar  进度条控件  timer 定时器 下面是源码及效果图: /// &l ...

  8. 自动生成.py文件头部的C语言小程序

    每次都 vi xxx.py 然后再打 #!/usr/bin/env python 等等的程序头信息感觉有点麻烦,于是便想着写一个小程序自动生成这些头信息了,顺便在 ~/.bashrc 里写入 alia ...

  9. c语言小程序

    这是一个用c语言写的小程序,功能是随机输出30道100以内的四则运算,先生成两个随机数,再通过随机数确定四则运算符号,最后输出题目. #include<iostream> using na ...

随机推荐

  1. Java笔记6:多态

    一.多态的分类对象的多态性:动物 x = new 猫();函数的多态性:函数重载.重写 二.多态的体现父类的引用指向了自己的子类对象父类的引用也可以接收自己的对象 三.多态的前提必须是类与类之间只有关 ...

  2. Kafka 集群搭建 (自用)

    Zookeeper集群搭建 1.软件环境 (3台服务器-测试环境) 192.168.56.9 192.168.56.6 192.168.56.7 1.Linux服务器一台.三台.五台.(2*n+1), ...

  3. MongoDB mongoimport 报错:lost connection to server

    MongoDB对单次处理有大小限制,所以导入大文件会出问题. mongoimport 默认10000条 为一批导入,但如果单条数据过大,就会导致单次处理数据超过大小限制. 参数 --batchSize ...

  4. JSP页面的基本结构 及声明变量

    一.JSP页面的基本结构 在传统的HTML页面文件里增加Java程序片和JSP标签就构成了一个JSP页面文件. 一个JSP页面可由5种元素组合而成: 1.普通的HTML标记符 2.Jsp标签.如指令标 ...

  5. easyui required 提交验证

    使用easyui时,对于提交验证,不不过在标签属性中加入data-options=required:true这句话这么来的.还须要另外加上才写东西能够把验证完整实现 1.设置from的属性 <f ...

  6. python列表解析和正同表达式

    正则表达式 [i for i in ['1232','233','22'] if re.match('^233$', i)]   return  ['233']

  7. Android笔记:invalidate()和postInvalidate() 的区别及使用——刷新ui

    Android提供了Invalidate方法实现界面刷新,但是Invalidate不能直接在线程中调用,因为他是违背了单线程模型:Android UI操作并不是线程安全的,并且这些操作必须在UI线程中 ...

  8. Java 遍历一个对象的属性 将非空属性赋值给另一个对象

    //将origin属性注入到destination中 public <T> void mergeObject(T origin, T destination) { if (origin = ...

  9. shell脚本监控调度器/proc进程是否运行(嵌套循环)

    /proc/<pid>/schedstat $/schedstat First: , Second:time spent waiting on a runqueue,这个值与上面的se.w ...

  10. out传值

    public void Out(out int a, out int b)        {//out相当于return返回值            //可以返回多个值            //拿过 ...