strcat()拼接两个字符串,保存到第一个字符串数组里,所以第一个字符串长度要预够长。返回一个指向第一个字符串数组的指针。
1 2 3 4 5 6 7 |
extern _ARMABI char *strcat(char * __restrict /*s1*/, const char * __restrict /*s2*/) __attribute__((__nonnull__(1,2))); /* * appends a copy of the string pointed to by s2 (including the terminating * null character) to the end of the string pointed to by s1. The initial * character of s2 overwrites the null character at the end of s1. * Returns: the value of s1. */ |
strncat()拼接2个字符串,并且只取不长于指定长度的第二个字符串的内容拼接到第一个字符串后面。返回一个指向第一个字符串数组的指针。
1 2 3 4 5 6 7 8 9 |
extern _ARMABI char *strncat(char * __restrict /*s1*/, const char * __restrict /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); /* * appends not more than n characters (a null character and characters that * follow it are not appended) from the array pointed to by s2 to the end of * the string pointed to by s1. The initial character of s2 overwrites the * null character at the end of s1. A terminating null character is always * appended to the result. * Returns: the value of s1. */ |
这两函数定义在string.h.
string.h在“C:\Keil_v5\ARM\ARMCC\include”