char *strcpy(char *strDestination, const char *strSource);复制源串strSource到目标串strDestination所指定的位置, 包含NULL结束符。 不能处理源串与目标串重叠的情况。函数返回strDestination值。
char *strncpy(char *strDestination, const char *strSource, size_t count);将源串strSource开始的count个字符复制到目标串strDestination所指定的位置。 如果count值小于或等于strSource串的长度, 不会自动添加NULL结束符目标串中, 而count大于strSource串的长度时, 则将strSource用NULL结束符填充补齐count个字符, 复制到目标串中。 不能处理源串与目标串重叠的情况。c++ strchr函数函数返回strDestination值。
char *strset(char *string, int c);将string串的所有字符设置为字符c, 遇到NULL结束符停止。 函数返回内容调整后的string指针。
char *strnset(char *string, int c, size_t count);将string串开始count个字符设置为字符c, 如果count值大于string串的长度, 将用string的长度替换count值。 函数返回内容调整后的string指针。
size_t strspn(const char *string, const char *strCharSet);查找任何一个不包含在strCharSet串中的字符 (字符串结束符NULL除外) 在string串中首次出现的位置序号。 返回一个整数值, 指定在string中全部由characters中的字符组成的子串的长度。 如果string以一个不包含在strCharSet中的字符开头, 函数将返回0值。
size_t strcspn(const char *string, const char *strCharSet);查找strCharSet串中任何一个字符在string串中首次出现的位置序号, 包含字符串结束符NULL.返回一个整数值, 指定在string中全部由非characters中的字符组成的子串的长度。 如果string以一个包含在strCharSet中的字符开头, 函数将返回0值。
char *strspnp(const char *string, const char *strCharSet);查找任何一个不包含在strCharSet串中的字符 (字符串结束符NULL除外) 在string串中首次出现的位置指针。 返回一个指针, 指向非strCharSet中的字符在string中首次出现的位置。
char *strpbrk(const char *string, const char *strCharSet);查找strCharSet串中任何一个字符在string串中首次出现的位置, 不包含字符串结束符NULL.返回一个指针, 指向strCharSet中任一字符在string中首次出现的位置。 如果两个字符串参数不含相同字符, 则返回NULL值。
int strcmp(const char *string1, const char *string2);比较字符串string1和string2大小。
返回值< 0, 表示string1小于string2;返回值为0, 表示string1等于string2;返回值> 0, 表示string1大于string2.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-33642-5.html
五元一吨
多好
股市