码迷,mamicode.com
首页 >  
搜索关键字:argv    ( 3650个结果
KVO机制
#import #import "Person.h"#import "BankAccount.h"int main(int argc, const char * argv[]){// 实例化一个人, 表示是这个名字叫wangdelong的人, 准备在银行开户 Person *person = [[....
分类:其他好文   时间:2014-07-19 21:38:02    阅读次数:272
获取窗口句柄
1、使用FindWindow函数获取窗口句柄示例:使用FindWindow函数获取窗口句柄,然后获得窗口大小和标题,并且移动窗口到指定位置。[html] view plaincopy#include#include#include#includeintmain(intargc,char*argv[]...
分类:其他好文   时间:2014-07-19 20:20:20    阅读次数:170
0716-----C++Primer听课笔记----------STL之顺序容器、迭代器
1. 顺序容器的初始化操作1.1 顺序容器(vector,list,deque)的五种初始化方法,以 vector 为例。#include #include #include using namespace std;int main(int argc, const char *argv[]){ .....
分类:编程语言   时间:2014-07-19 19:27:08    阅读次数:278
4.1 对每个命令行参数打印文件类型
file/filetype.c #include "apue.h"intmain(int argc, char *argv[]){ int i; struct stat buf; char *ptr; for (i = 1; i < argc; i++) { printf("%s: ", argv[...
分类:其他好文   时间:2014-07-18 23:38:27    阅读次数:412
整型范围内的斐波那契数列
#include "stdafx.h"int _tmain(int argc, _TCHAR* argv[]){ int a = 1, b = 1, c = 0; int max = 0x7FFFFFFF; printf("%d\n", max);// 打印一下整型的最大值 ...
分类:其他好文   时间:2014-07-18 23:36:57    阅读次数:191
3.4 对于指定的描述符打印文件标志
file/fileflags.c #include "apue.h"#include intmain(int argc, char *argv[]){ int val; if (argc != 2) err_quit("usage: a.out "); if ((val = fcntl(atoi(a...
分类:其他好文   时间:2014-07-18 23:28:24    阅读次数:203
碉堡了,python识别黄色图片
创建testimg.pyimport sysfrom PIL import Image img = Image.open(sys.argv[1]).convert('YCbCr') w, h = img.size data = img.getdata() cnt = 0 ...
分类:编程语言   时间:2014-07-18 19:19:52    阅读次数:358
如何使用getopt()函数解析参数
最近在写程序的过程中,把一部分时间都花费在程序对参数的处理上。今天听了学长说到getopt函数,才发现原来c里面还有一个专门解决参数处理的函数,查询了相关资料,这里简单总结一下。使用int main( int argc, char *argv[] )(或int main( int argc, cha...
分类:其他好文   时间:2014-07-18 14:17:53    阅读次数:227
解析配置文件
fopen打开配置文件,不需要绝对路径,可以使相对路径fgets按行读取文件while(fgets(buf, 1024, fptr)){}strtok_r或者strtok解析参数 int main(int argc, char *argv[]) { ...
分类:其他好文   时间:2014-07-18 12:14:09    阅读次数:187
列出一个目录中的所有文件
file/ls1.c 1 #include "apue.h" 2 #include 3 int 4 main(int argc, char *argv[]) 5 { 6 DIR *dp; 7 struct dirent *dirp; 8 if (...
分类:其他好文   时间:2014-07-14 14:20:31    阅读次数:186
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!