猿问

c++ <string.h>中包括哪些函数?

c++ <string.h>中包括哪些函数?


一只萌萌小番薯
浏览 553回答 2
2回答

慕哥9229398

常用函数:strlen 求字符串长度strcmp 比较2个字符串是否一样strcat 字符串连接操作strcpy 字符串拷贝操作strstr 查询子串更具体的你可以查阅msdn

30秒到达战场

功能里面写了阿,还要我翻译阿FunctionsCopying:memcpy Copy block of memory (function)copy内存块memmove&nbsp;Move&nbsp;block of memory (function)移动内存快strcpy Copy string (function)copy字符串strncpy Copy characters from string (function)从字符串里copy出字符Concatenation:合并strcat Concatenate strings (function)合并字符串strncat Append characters from string (function)也是合并,可以指定选用前多少个字符Comparison:比较memcmp Compare two blocks of memory (function)比较两块内存strcmp Compare two strings (function)比较两个字串strcoll Compare two strings using locale (function)strncmp Compare characters of two strings (function)比较两个字符串中的字符strxfrm Transform string using locale (function)采用目前区域的字符排列次序来比较字符串Searching:memchr Locate character in block of memory (function)在一块内存中定位字符strchr Locate first occurrence of character in string (function)找第一次出现的strcspn Get span until character in string (function)找两串里第一个一样的strpbrk Locate character in string (function)在string里找charstrrchr Locate last occurrence of character in string (function)最后一次出现strspn Get span of character set in string (function)找字符集strstr Locate substring (function)子串strtok Split string into tokens (function)分割字符串Other:memset Fill block of memory (function)strerror Get pointer to error message string (function)strlen Get string length (function)
随时随地看视频慕课网APP

相关分类

MySQL
我要回答