网络建站网网络推广,可信网站的作用,定制开发企业,网站建设及发布的流程文章目录 strcat() 函数strncat() 函数 strcat() 函数
原型: char *strcat(char *dest, const char *src)
参数:
dest – 指向目标数组#xff0c;该数组包含了一个 C 字符串#xff0c;且足够容纳追加后的字符串。
src – 指向要追加的字符串#xff0c;该字符串不会覆… 文章目录 strcat() 函数strncat() 函数 strcat() 函数
原型: char *strcat(char *dest, const char *src)
参数:
dest – 指向目标数组该数组包含了一个 C 字符串且足够容纳追加后的字符串。
src – 指向要追加的字符串该字符串不会覆盖目标字符串。
返回值: 该函数返回一个指向最终的目标字符串 dest 的指针。
头文件: string.h
The strcat() (for string concatenation ) function takes two strings for arguments. A copy of the second string is tacked onto the end of the first, and this combined version becomes the new first string. The second string is not altered. The strcat() function is type char * (that is, a pointer-to- char ). It returns the value of its first argument—the address of the first character of the string to which the second string is appended.
strncat() 函数
头文件: string.h
char *strncat(char *dest, const char *src, size_t n)
参数
dest – 指向目标数组该数组包含了一个 C 字符串且足够容纳追加后的字符串包括额外的空字符。
src – 要追加的字符串。
n – 要追加的最大字符数。
把 src 所指向的字符串追加到 dest 所指向的字符串的结尾直到 n 字符长度为止。
返回值: 该函数返回一个指向最终的目标字符串 dest 的指针。