10092

来源:互联网 发布:算法的概念一等奖ppt 编辑:程序博客网 时间:2024/05/16 09:14
//编写函数void copy(char str1[],char str2[])实现将第二个串复制到第一个串中
#include<stdio.h>
void copy(char *str1, char *str2)  

    while(*str1++ = *str2++); 
}
void main()
{
    char s1[] = "abcd";
    char s2[5];
    copy(s2, s1);  
    printf("%s\n", s2);  
}
0 0
原创粉丝点击