内置函数 字符串的复制 strcpy

 1 #include<stdio.h>
 2 #include<stdlib.h>
 3 #include<string.h>
 4 
 5 
 6 void main()
 7 {
 8 
 9     char str1[50];
10     char str2[20];
11     printf("输入目的字符串:");
12     gets(str1);
13     printf("输入源字符串:");
14     gets(str2);
15     strcpy(str1,str2);
16     printf("*********复制后********\n");
17     printf("目的字符串:%s\n",str1);
18     printf("源字符串:%s\n",str2);
19 
20 
21 
22 
23 }

 

posted on 2021-07-28 09:25  Bytezero!  阅读(45)  评论(0编辑  收藏  举报