yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 355 356 357 358 359 360 361 362 363 ··· 367 下一页

2014年11月12日 #

摘要: char * strdup(char *str) { char * strNew; assert(str != NULL); strNew = (char *)malloc(strlen(str)+1); strcpy(strNew,str); return strNew;} ... 阅读全文
posted @ 2014-11-12 02:36 xxxxxxxx1x2xxxxxxx 阅读(241) 评论(0) 推荐(0)

摘要: #include#includeint my_strlen(const char* strDest){ assert(NULL!=strDest); if('\0'==*strDest) return 0; else return(1+my_strlen... 阅读全文
posted @ 2014-11-12 02:35 xxxxxxxx1x2xxxxxxx 阅读(202) 评论(0) 推荐(0)

摘要: #includechar *my_strncpy(char *dest,char *src,int n){ int i; for(i=0;i<n && src[i]!='\0';i++) dest[i] = src[i]; for(;i<n;i++) ... 阅读全文
posted @ 2014-11-12 02:28 xxxxxxxx1x2xxxxxxx 阅读(180) 评论(0) 推荐(0)

摘要: #include#includeint main(){char buf[512],sztime1[16],sztime2[16];sscanf("123456 ", "%s", buf);//此处buf是数组名,它的意思是将123456以%s的形式存入buf中!printf("%s\n", buf)... 阅读全文
posted @ 2014-11-12 02:26 xxxxxxxx1x2xxxxxxx 阅读(178) 评论(0) 推荐(0)

摘要: #include#includeint my_strcmp(const char*a,const char*b){ while(*a&&*b&&*a==*b) a++,b++; if(*a&&*b) return(*a-*b); else if(*a&&... 阅读全文
posted @ 2014-11-12 02:23 xxxxxxxx1x2xxxxxxx 阅读(231) 评论(0) 推荐(0)

摘要: // strstr.c查找完全匹配的子字符串#include#includechar *my_strstr(const char *s1,const char *s2){ const char *p=s1; const int len=strlen(s2); for(;(p=str... 阅读全文
posted @ 2014-11-12 02:15 xxxxxxxx1x2xxxxxxx 阅读(168) 评论(0) 推荐(0)

摘要: 本文转载 《高效程序员的45个习惯》一书 目录第1章 敏捷---高效软件开发之道第2章 态度决定一切1.做事2.欲速则不达3.对事不对人4.排除万难,奋勇前进第3章 学无止境5.跟踪变化6.对团队投资7.懂得丢弃8.打破沙锅问到底9.把握开发节奏第4章交付用户想要的软件10.让客户做决定11.让... 阅读全文
posted @ 2014-11-12 02:09 xxxxxxxx1x2xxxxxxx 阅读(1561) 评论(1) 推荐(0)

摘要: 实现:char *strcpy(char *strDestination,const char *strSource){assert(strDestination!=NULL && strSource!=NULL);char *strD=strDestination;while ((*strDest... 阅读全文
posted @ 2014-11-12 02:07 xxxxxxxx1x2xxxxxxx 阅读(391) 评论(0) 推荐(0)

2014年11月11日 #

摘要: 1. C语言变量主要分为全局变量、静态全局变量、局部变量、静态局部变量和寄存器变量。其中静态变量用static关键字进行修饰。程序所占用的内存可以分为以下几个部分:(1)代码段-存放程序代码,只读的,不能修改。(2)全局区(静态区),又称为数据段。其中.data段存放的是已经初始化的全局变量和静态变... 阅读全文
posted @ 2014-11-11 19:43 xxxxxxxx1x2xxxxxxx 阅读(490) 评论(0) 推荐(0)

2014年11月10日 #

摘要: 1.写出正面程序支行结果:#includeusing namespace std;void func(int a){ static int c = a; c++; cout using namespace std;class A{public: virtual void fu... 阅读全文
posted @ 2014-11-10 23:56 xxxxxxxx1x2xxxxxxx 阅读(179) 评论(0) 推荐(0)

上一页 1 ··· 355 356 357 358 359 360 361 362 363 ··· 367 下一页