string.h
mylove10086
;ldfk
展开
-
C Primer Plus学习 二十七 string.h strcat()函数
strcat ()(代表string concatenation)函数接受两个字符串参数。它将第二个字符串的一份拷贝添加到第一个字符串的结尾,从而使第一个字符串成为一个新的组合字符串,第二个字符串并没有改变。strcat () 函数是char* (指向char的指针)类型。这个函数返回它的第一个参数的值,即其后添加了第二个字符串的那个字符串中第一个字符的地址。/* str_cat.c --连接原创 2016-10-10 21:49:13 · 214 阅读 · 0 评论 -
C Primer Plus学习 二十八 string.h strlen ()函数
用strlen ()函数可以得到字符串的长度。下面的函数中用到了 strlen ()函数,这是 一个可以缩短字符串长度的函数:/* test.c 试用缩短字符串的函数*/#include#include/*该头文件中包含字符串函数的原型*/void fit(char*,unsigned int);int main(void){char mesg[]={"Hold o原创 2016-10-10 21:54:04 · 261 阅读 · 0 评论