【C语言】将两个字符串连接起来
#include<stdio.h> int main() { char s1[100] = "I "; char s2[100] = "am a student"; int i, j, n; for (i = 0; s1[i] != '\0'; i++) ; n = i; for (j = 0; s2[j] != '\0'; j++) { s1[n] = s2[j]; n = n + 1; } s1[n] = '\0'; printf("%s", s1); }
本文来自博客园,作者:木子欢儿,转载请注明原文链接:https://www.cnblogs.com/HGNET/p/11965886.html