码迷,mamicode.com
首页 >  
搜索关键字:argv    ( 3650个结果
详解C语言的main函数
如图所示:#include这是一个头文件,包含的是C程序运行的C语言的库函数,只有包含了相关的头文件,在程序中才能调用。stdio表示输入输出控制。printf();就是来自这个头文件。int main(int argc ,const char *argv[]){...} :int 表示函数的返.....
分类:编程语言   时间:2015-04-27 20:06:00    阅读次数:172
SSH自动登录脚本
#!/usr/bin/expect -f set timeout 10 set name [lindex $argv 0] set pwd [lindex $argv 1] set ip [lindex $argv 2] spawn ssh -l $name $ip expect "password:" send "$pwd\r" interact...
分类:其他好文   时间:2015-04-27 11:22:01    阅读次数:110
errno.c
#include #include #include int main(int argc, char *argv[]) { fprintf(stderr, "EACCES : %s\n",strerror(EACCES)); errno = ENOENT; perror(argv[0]); return 0; }函数fprintf:int fprintf(FILE *stream,...
分类:其他好文   时间:2015-04-26 22:56:07    阅读次数:330
linux进程池模型
static int nchildren;static pid_t* pids;int main(int argc,char**argv){ int listenfd,i; socklen_t addrlen; void sig_int(int); pid_t child_mak...
分类:系统相关   时间:2015-04-26 22:40:21    阅读次数:236
大虫子
1 #include 2 #include 3 #include 4 int main(int argc, char* argv[]) 5 { 6 while(1) 7 { 8 for(int i=0 ; i0 ; --i)17 {18 ...
分类:其他好文   时间:2015-04-26 22:39:07    阅读次数:185
TCp客户/服务器程序示例
1. TCP回射服务器程序:main函数 #include "unp.h" int main(int argc, char **argv) { int listenfd, connfd; pid_t childpid; socklen_t clilen; struct sockaddr_in cliaddr, servaddr; listenfd = Socket(AF_INET,...
分类:其他好文   时间:2015-04-26 16:50:44    阅读次数:146
openvc中读取图像访问图像中像元的的方法
一、读取图像1、利用Mat数据结构读取和显示图片#include"cv.h"#include "highgui.h"#includeusing namespace std;using namespace cv;int _tmain(int argc, _TCHAR* argv[]){ Mat i.....
分类:其他好文   时间:2015-04-26 15:06:59    阅读次数:207
C++文件操作(二)
/* 文件拷贝程序 即将src.dat拷贝到dest.dat 如果dest.dat原来就有,则原来的文件就会被覆盖 */ #include #include using namespace std; int main(int argc, char * argv []){ if (argc != 3){ cout << "File name missing!" << endl; ...
分类:编程语言   时间:2015-04-26 09:26:01    阅读次数:161
myls.c
#include #include #include int main(int argc, char *argv[]) { DIR *dp; struct dirent *dirp; if(argc != 2){ printf("usage: ls directory_name\n");...
分类:其他好文   时间:2015-04-26 01:19:33    阅读次数:167
fopen返回一个文件指针
#include<stdio.h> #include<stdlib.h> intmain(intargc,char*argv[]) { intch; longcount=0; FILE*fp; if(argc!=2) { printf("请输入一个参数\n"); exit(1); } if((fp=fopen("write.txt","r"))==NULL) { printf("不能打开这个文件\n"); exit(2); } while((ch=get..
分类:其他好文   时间:2015-04-25 00:28:03    阅读次数:160
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!