标题:[求助]还是字符串的问题啊
只看楼主
haishanglang
Rank: 1
等 级:新手上路
帖 子:378
专家分:0
注 册:2006-3-2
得分:0 

#include<stdio.h>
void main()
{ //获取字符串a,b
void strcopy(char *to,char *from);
char * a,* b;
int i;
a=(char *)malloc(sizeof(char) * 5);
b=(char *)malloc(sizeof(char) * 5);
gets(a);
gets(b);
strcopy(a,b);
puts(a);
puts(b);
}
void strcopy(char *from,char *to)
{
while(*to++=*from++);
}


2006-03-16 22:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-50901-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.906219 second(s), 10 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved