2015年5月16日

时间优先字符串压缩与解压缩

摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 // 时间优先 8 char * timefastzip(char *str) 9 {10 int length = strlen(str);//获取长度11 ... 阅读全文

posted @ 2015-05-16 21:53 Dragon-wuxl 阅读(124) 评论(0) 推荐(0)

结构体,匿名结构体的变量多种初始化方式

摘要: 1 #include 2 #include 3 4 struct MyStructA 5 { 6 int num; 7 char str[10]; 8 }s1={10,"123"}; // 第一种结构体初始化方式 注意初始化的顺序要一致 9 10 struct MyStruct... 阅读全文

posted @ 2015-05-16 15:49 Dragon-wuxl 阅读(543) 评论(0) 推荐(0)

结构体初识,结构体的定义,匿名结构体,结构体的嵌套

摘要: 1 #include 2 #include 3 4 // 定义一个结构体 5 struct student 6 { 7 char name[20]; 8 int age; 9 long long telephone;10 double score;11 };12 ... 阅读全文

posted @ 2015-05-16 14:37 Dragon-wuxl 阅读(293) 评论(0) 推荐(0)

判断输入的字符串是否对称

摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 5 int issymmetry(char *str)// 判读输入的字符串是否对称 6 { 7 int flag = 1; // 假定一开始0为不对称,1为对称 8 ... 阅读全文

posted @ 2015-05-16 09:27 Dragon-wuxl 阅读(288) 评论(0) 推荐(0)

2015年5月15日

删除字符串表达式空格以及对包含加减运算符字符串进行计算结果

摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 5 // 指针法 6 void pointeatspace(char *str)// 对字符串做去除空格处理 7 { 8 char *p1 = str; ... 阅读全文

posted @ 2015-05-15 15:41 Dragon-wuxl 阅读(313) 评论(0) 推荐(0)

2015年5月14日

宽字符的学习以及手动实现相关函数 ------ wcslen,strcpy

摘要: 1 #include 2 #include 3 #include 4 5 6 // 手动实现 统计宽字符的个数 7 int mywcslen(wchar_t *wstr) 8 { 9 int i = 0;10 for (;*wstr!=L'\0';)11 {12 ... 阅读全文

posted @ 2015-05-14 20:23 Dragon-wuxl 阅读(298) 评论(0) 推荐(0)

自己实现可变参数printf函数 ------ myprintf

摘要: 1 #include 2 #include 3 #include 4 5 void myprintf(char *ptstr,...) // 可变参数 6 { 7 va_list ap;//作为起始点 8 va_start(ap,ptstr);// 从起始点开始读取ptstr 9... 阅读全文

posted @ 2015-05-14 10:57 Dragon-wuxl 阅读(785) 评论(0) 推荐(0)

管道与字符串,判断QQ是否运行以及QQ当前运行的个数

摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 #include 5 6 int exeshell(char *cmd,char *result)// cmd为传递的指令 result 为返回的结果 7 { 8 ... 阅读全文

posted @ 2015-05-14 08:52 Dragon-wuxl 阅读(215) 评论(0) 推荐(0)

2015年5月13日

调用sprintf函数将实数打印到字符串及手动实现实数转字符串函数 ------ ftoa

摘要: 1 #define _CRT_SECURE_NO_WARNINGS 2 #include 3 #include 4 5 char *ftoa(double db, char *str);// 手动实现将实数转化为字符串 6 7 // 实数转字符串 8 void main() 9 {10 ... 阅读全文

posted @ 2015-05-13 16:43 Dragon-wuxl 阅读(637) 评论(0) 推荐(0)

调用函数实现字符串转实数以及手动实现该功能 ----- atof

摘要: 1 #include 2 #include 3 4 5 double myatof(char *str);// 手动实现 将字符串转化为实数 6 7 void main() 8 { 9 char str[30] = "123.3456";10 double db = atof... 阅读全文

posted @ 2015-05-13 14:45 Dragon-wuxl 阅读(291) 评论(0) 推荐(0)

导航