字符函数和字符串函数和内存操作函数
字符串函数 (1) strlen —— 求字符串长度的库函数(重点理解)
字符串已经 ‘\0’ 作为结束标志,strlen函数返回的是在字符串中 ‘\0’ 前面出现的字符个数(不包 含 ‘\0’ )。 参数指向的字符串必须要以 ‘\0’ 结束。 注意函数的返回值为size_t,是无符号的( 易错 )
strlen 函数的实现:  2)strcpy—字符串拷贝函数(重点理解)  源字符串必须以 ‘\0’ 结束。 会将源字符串中的 ‘\0’ 拷贝到目标空间 目标空间必须足够大,以确保能存放源字符串 目标空间必须可变
strcpy函数的模拟实现  (3)strcat----字符串连接函数(重点理解)  源字符串必须以 ‘\0’ 结束。 目标空间必须有足够的大,能容纳下源字符串的内容。 目标空间必须可修改。
strcat函数模拟实现  (4)strcmp—字符串比较函数(重点理解)  标准规定: 第一个字符串大于第二个字符串,则返回大于0的数字 第一个字符串等于第二个字符串,则返回0 第一个字符串小于第二个字符串,则返回小于0的数字
strcmp函数的模拟实现  总结: strcpy strcat strcmp是 长度不受限制的字符串函数
长度受限制的字符串函数 (1) strncpy–字符串拷贝函数(精确到拷贝到第几个)(重点理解) 功能特点: (1)count<=strlen(strSource),即要拷贝的字符个数小于等于strSource字符串的长度时,只将字符拷贝过去,不拷贝’\0’
 (2)count>strlen(strSource),即要拷贝的字符个数大于strSource字符串的长度时,会将strSource字符串整个拷贝,不管count是多少,只要 count>strlen(strSource)就行  strncpy函数的模拟实现  (2) strncat----字符串连接函数(精确到第几个)(重点理解)  功能特点: 无论,count为多少,在最后都会加上’\0’
strncat函数的模拟实现  (3)strncmp—字符串比较函数(精确的第几个比较)(重点理解)
 功能特点: 比较字符串string1和字符串string2前count个元素的大小
strncmp函数的实现  字符串查找函数 (1) strstr—寻找 字串的函数(重点理解)
strstr函数是作用于字符串的 
strstr函数的返回值 : 1.如果在被查找的字符串中,有相应的子字符串,则返回第一个子字符串首元素的地址, 如果没有相应的子字符串,则返回NULL, 2.如果子字符串的长度为0,即只要一个元素‘\0’,则返回被查找的字符串
strstr函数模拟实现  (2) strtok(重点理解)  1.sep参数是个字符串,定义了用作分隔符的字符集合 2.第一个参数指定一个字符串,它包含了0个或者多个由sep字符串中一个或者多个分隔符分割的标记。 3. strtok函数找到str中的下一个标记,并将其用 \0 结尾,返回一个指向这个标记的指针。(注: strtok函数会改变被操作的字符串,所以在使用strtok函数切分的字符串一般都是临时拷贝的内容 并且可修改。) strtok函数的第一个参数不为 NULL ,函数将找到str中第一个标记,strtok函数将保存它在字符串 中的位置。 strtok函数的第一个参数为 NULL ,函数将在同一个字符串中被保存的位置开始,查找下一个标 记。 如果字符串中不存在更多的标记,则返回 NULL 指针  错误信息报告函数
strerror函数(重点理解)     字符分类函数
 字符转换  内存操作函数(重点理解)
(1) memcpy–内容拷贝函数 memcpy与strcpy的区别: strcpy只能用于字符串拷贝,而memcpy可以用于任何情况  函数memcpy从source的位置开始向后复制num个字节的数据到destination的内存位置。 这个函数在遇到 ‘\0’ 的时候并不会停下来。 如果source和destination有任何的重叠,复制的结果都是未定义的(memcpy不能支持重叠的情况)
 memcpy函数的模拟实现  (2)memmove----内容拷贝函数 适用于任何情况

可以理解为memmove的功能比memcpy的功能更加全面
memmove函数的模拟实现  3)memcmp----比较大小的函数 适用于任何情况,而strcmp只适用于字符串
  (4)memset  设置count个字节的数值为c; dest表示你要设置的空间的地址
|