1. strlen(const char *str) - 返回字符串的长度(不包括空字符'\0')。
  2. strcpy(char *destination, const char *source) - 将源字符串复制到目标字符串中。
  3. strncpy(char *destination, const char *source, size_t n) - 将源字符串的前n个字符复制到目标字符串中。
  4. strcat(char *destination, const char *source) - 将源字符串追加到目标字符串的末尾。
  5. strncat(char *destination, const char *source, size_t n) - 将源字符串的前n个字符追加到目标字符串的末尾。
  6. strcmp(const char *str1, const char *str2) - 比较两个字符串,并返回一个整数表示它们的相对顺序。
  7. strncmp(const char *str1, const char *str2, size_t n) - 比较两个字符串的前n个字符,并返回一个整数表示它们的相对顺序。
  8. strchr(const char *str, int c) - 在字符串中搜索指定字符,并返回指向该字符的指针。
  9. strrchr(const char *str, int c) - 在字符串中搜索指定字符的最后一次出现,并返回指向该字符的指针。
  10. strstr(const char *haystack, const char *needle) - 在字符串中搜索指定的子字符串,并返回指向该子字符串的指针
字符串函数的原型及该字符串函数的功能至少10个

原文地址: https://www.cveoy.top/t/topic/h9AI 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录