C(string.h)字符串操做函數總結

1.strcpy函數 原型:strcpy(str1,str2);html 功能:將字符串str2複製到字符串str1中,並覆蓋str1原始字符串,能夠用來爲字符串變量賦值數組 返回:str1安全 注意:1)字符串str2會覆蓋str1中的所有字符,2)字符串str2的長度不能超過str1函數 char str1[] = "We are csdn!"; char str2[] = "Hello!";
相關文章
相關標籤/搜索