上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 48 下一页
摘要: #include <stdio.h>#include <string.h>#include <assert.h>#include <stdlib.h>char *mystrncpy(char *dst, const char *src, size_t n){ assert(dst != NULL && src != NULL); char *dstCopy = dst; while (n && (... 阅读全文
posted @ 2012-12-05 17:43 helloweworld 阅读(908) 评论(0) 推荐(0) 编辑
摘要: http://bbs.chinaunix.net/thread-25356-1-1.html #include <stdio.h>#include <string.h>#include <assert.h>#include <stdlib.h>char *strcpy(char *strDest, const char *strSrc){ assert(strDest != NULL && st... 阅读全文
posted @ 2012-12-05 16:55 helloweworld 阅读(203) 评论(0) 推荐(0) 编辑
摘要: http://www.onmoso.com/android/331.html 阅读全文
posted @ 2012-12-05 16:55 helloweworld 阅读(328) 评论(0) 推荐(0) 编辑
摘要: #include <assert.h>void assert(scalar expression);表达式为假,则调用abort终止程序的执行。也就是说,只有在满足表达式的情况下,程序才继续执行。 阅读全文
posted @ 2012-12-05 11:03 helloweworld 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 首先要知道控制字符,可打印字符等所对应的ASCII码是多少。 0-31和127 控制字符 32-126 可打印字符 65-90 大写字母 97-122 小写字母 48-57 0-9数字 32 空格 字符类测试库函数所在头文件 <ctype.h> isupper()测试字符是否为大写英文字 ispunct()测试字符是否为标点符号或特殊符号 isspace()测试字符是否为空格字符 isprin... 阅读全文
posted @ 2012-12-04 19:46 helloweworld 阅读(307) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <ctype.h>/*大小写转换的库函数:int tolower(int c)int toupper(int c)*/int my_tolower(unsigned char c){ return (c + ('a' - 'A'));}int my_toupper(unsigned char c){ return (c - ('a' - 'A'... 阅读全文
posted @ 2012-12-04 19:35 helloweworld 阅读(193) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <ctype.h>/*判断是控制字符(ASCII 0-31和127)的库函数:满足指定的条件,返回非0;否则返回0.iscntrl(c)*//*************** * 输入:要判断的字符。 * 输出:是空白,返回1;其他,返回0. **************/int my_iscntrl(unsigned char c){ if (... 阅读全文
posted @ 2012-12-04 19:25 helloweworld 阅读(381) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <ctype.h>/*判断是空白(空格-ASCII 32,换页-12,换行-10,回车-13,横向制表-9,纵向制表-11)的库函数:满足指定的条件,返回非0;否则返回0.isspace(c)*//*************** * 输入:要判断的字符。 * 输出:是空白,返回1;其他,返回0. **************/int my_is... 阅读全文
posted @ 2012-12-04 19:17 helloweworld 阅读(548) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <ctype.h>/*判断是字母或数字的库函数:满足指定的条件,返回非0;否则返回0.isalpha(c)isdigit(c)*//*************** * 输入:要判断的字符。 * 输出:是字母,返回1;其他,返回0. **************/int my_isalpha(unsigned char c){ if ((c >=... 阅读全文
posted @ 2012-12-04 18:57 helloweworld 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <ctype.h>/*判断大小写的库函数:满足指定的条件,返回非0;否则返回0.isupper(c)islower(c)*//*************** * 输入:要判断的字符。 * 输出:是小写,返回1;其他,返回0. **************/int my_islower(unsigned char c){ if (c >= 'a'... 阅读全文
posted @ 2012-12-04 18:48 helloweworld 阅读(769) 评论(0) 推荐(0) 编辑
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 48 下一页