#include <stdio.h> #include <string.h> int main () { char str[80]; strcpy (str,"these "); strcat (str,"strings "); strcat (str,"are "); strcat (str,"concatenated."); puts (str); return0; } //以上是字符串拼接的例子,总体来说还是没有sprintf好用
#include <stdio.h> #include <string.h> int main () { char str[80]; strcpy (str,"these "); strcat (str,"strings "); strcat (str,"are "); strcat (str,"concatenated."); puts (str); return0; } //以上是字符串拼接的例子,总体来说还是没有sprintf好用