把一维字符串数组拷贝到二维字符串数组中
作者:互联网
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main()
{
char A[10] = { "ABCDE" };
int i = 0;
char B[10][10] = { "" };
char C[10] = { "" };
while (i<10)
{
strcpy(B[i], A);
i++;
}
printf("%s\n%s\n%s\n", B[1], B[2], B[3]);
return 0;
}
运行结果:
标签:10,include,int,n%,char,数组,字符串,拷贝到 来源: https://blog.csdn.net/jueshengqiu/article/details/121725399