上一页 1 2 3 4 5 6 7 8 9 ··· 73 下一页
摘要: C语言 atof 功能:把一个小数形式的字符串转化为一个浮点数。 案例 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #incl 阅读全文
posted @ 2020-02-28 19:09 kevin.Xiang 阅读(457) 评论(0) 推荐(0) 编辑
摘要: C语言 atoi #include <stdlib.h> int atoi(const char *nptr); 功能:atoi()会扫描nptr字符串,跳过前面的空格字符,直到遇到数字或正负号才开始做转换,而遇到非数字或字符串结束符('\0')才结束转换,并将结果返回返回值。参数: nptr:待转 阅读全文
posted @ 2020-02-28 19:07 kevin.Xiang 阅读(321) 评论(0) 推荐(0) 编辑
摘要: C语言 strtok #include <string.h> char *strtok(char *str, const char *delim); 功能:来将字符串分割成一个个片段。当strtok()在参数s的字符串中发现参数delim中包含的分割字符时, 则会将该字符改为\0 字符,当连续出现多 阅读全文
posted @ 2020-02-28 19:04 kevin.Xiang 阅读(765) 评论(0) 推荐(0) 编辑
摘要: C语言 strstr #include <string.h> char *strstr(const char *haystack, const char *needle); 功能:在字符串haystack中查找字符串needle出现的位置参数: haystack:源字符串首地址 needle:匹配字 阅读全文
posted @ 2020-02-28 19:01 kevin.Xiang 阅读(767) 评论(0) 推荐(0) 编辑
摘要: C语言 strchr #include <string.h> char *strchr(const char *s, int c); 功能:在字符串s中查找字母c出现的位置参数: s:字符串首地址 c:匹配字母(字符) 返回值: 成功:返回第一次出现的c地址 失败:NULL 案例 #define _ 阅读全文
posted @ 2020-02-28 19:00 kevin.Xiang 阅读(549) 评论(0) 推荐(0) 编辑
摘要: C语言 sscanf #include <stdio.h> int sscanf(const char *str, const char *format, ...); 功能:从str指定的字符串读取数据,并根据参数format字符串来转换并格式化数据。参数: str:指定的字符串首地址 format 阅读全文
posted @ 2020-02-28 18:59 kevin.Xiang 阅读(348) 评论(0) 推荐(0) 编辑
摘要: C语言 sprintf #include <stdio.h> int sprintf(char *str, const char *format, ...); 功能:根据参数format字符串来转换并格式化数据,然后将结果输出到str指定的空间中,直到出现字符串结束符 '\0' 为止。参数: str 阅读全文
posted @ 2020-02-28 18:57 kevin.Xiang 阅读(532) 评论(0) 推荐(0) 编辑
摘要: C语言 strncmp #include <string.h> int strncmp(const char *s1, const char *s2, size_t n); 功能:比较 s1 和 s2 前n个字符的大小,比较的是字符ASCII码大小。 参数: s1:字符串1首地址 s2:字符串2首地 阅读全文
posted @ 2020-02-28 18:56 kevin.Xiang 阅读(845) 评论(0) 推荐(0) 编辑
摘要: C语言 strcmp #include <string.h> int strcmp(const char *s1, const char *s2); 功能:比较 s1 和 s2 的大小,比较的是字符ASCII码大小。参数: s1:字符串1首地址 s2:字符串2首地址 返回值: 相等:0 大于:>0 阅读全文
posted @ 2020-02-28 18:53 kevin.Xiang 阅读(681) 评论(0) 推荐(0) 编辑
摘要: C语言 strncat #include <string.h> char *strncat(char *dest, const char *src, size_t n); 功能:将src字符串前n个字符连接到dest的尾部,‘\0’也会追加过去参数: dest:目的字符串首地址 src:源字符首地址 阅读全文
posted @ 2020-02-28 18:52 kevin.Xiang 阅读(616) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 73 下一页