码迷,mamicode.com
首页 >  
搜索关键字:include    ( 84546个结果
用fseek和ftell获取文件的大小
#include #include #include int main(int argc,char *argv[]){ int n=0; FILE *fp; if((fp=fopen(argv[1],"r"))==NULL) { perror("fopen");...
分类:其他好文   时间:2014-05-02 18:05:54    阅读次数:308
ecl函数的用法
相关函数fork, execle, execlp, execv, execve, execvpWindows下头文件#include Linux下头文件#include 函数定义int execl(const char *path, const char *arg, ...);函数说明execl()...
分类:其他好文   时间:2014-05-02 17:52:52    阅读次数:674
拷贝构造函数[c++]
拷贝构造函数何时会被调用?1. 对象以值传递的方式传入函数参数2.对象以值传递的方式从函数返回3.对象需要通过另外一个对象进行初始化下面我们来看代码://#include //using namespace std;//template //T:队列的类型,char,int,double,包括自己....
分类:编程语言   时间:2014-05-02 17:33:17    阅读次数:401
用fread和fwrite实现文件复制操作
#include #include #include int main(int argc,char **argv){ FILE *fp_src,*fp_des; char buf[128]; int num; if(argc!=3) { printf("t...
分类:其他好文   时间:2014-05-02 16:06:36    阅读次数:562
OpenGL画圆
OpenGL画圆代码,代码很简单。。。截图如下:#include#include#includeGLint x=250;GLint y=450;void init(){ glClearColor(1.0,1.0,1.0,0.0); glMatrixMode(GL_PROJECTION);...
分类:其他好文   时间:2014-05-02 11:23:03    阅读次数:988
Chap5: question: 29 - 31
29. 数组中出现次数超过一半的数字. 方法a. 排序取中 O(nlogn). 方法b. partition 函数分割找中位数 >=O(n). 方法c. 设计数变量,扫描一遍。 O(n).#include bool Invalid_Input = false;int getNumber(int da...
分类:其他好文   时间:2014-05-02 10:46:15    阅读次数:340
C语言中字符串如何转换为二进制、八进制、十进制、十六进制
在C语言某个程序当中需要把文本16进制转换成对应的16进制数,比如字符串"0x1a"转换成10进制的26,可以用以下函数来实现相关函数: atof, atoi, atol, strtod, strtoul表头文件: #include 定义函数: long int strtol(const char ...
分类:编程语言   时间:2014-05-02 09:58:29    阅读次数:290
hdu 2196(树的最长链)
题意:输出从一颗树中所有结点出发可以走的最长的路。思路:先找到树上最长链然后判断两个端点中到每个结点远的距离就是答案。代码如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8...
分类:其他好文   时间:2014-05-02 08:55:38    阅读次数:192
void f(int(&p)[3]){} 和void f(int(*p)[3]){}的区别
#include using namespace std; void f(int(&p)[3]){          cout     cout } int main(){     int a1[3]={1,2,3};     cout     cout     f(a1); } 编译后输出:...
分类:其他好文   时间:2014-05-02 05:32:02    阅读次数:265
串的模式匹配算法(KMP)
算法: #include using namespace std; #define MAXSIZE 100 void calNext(const char *T,int *next);//T为模式串,next为预判数组 int kmp_match(const char *S,const char *T);//在主串S中寻找模式串T,如果找到返回其位置,否则返回-1。位置从0开始 void ...
分类:其他好文   时间:2014-05-02 02:25:40    阅读次数:280
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!