C语言的问题(新手提问)

xadm1986 xadm1986 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
帮忙看一下这个程序问题出在哪?
#include "stdio.h"
int main()
{
char *a = "abcd";
char *b = "1234";
strcpy1(a, b);
return 0;
}
void strcpy1(char *dest, char *src)
{
dest = src;
}

编译的时候报错:
"strcpy1.c", line 9.6: 1506-343 (S) Redeclaration of strcpy1 differs from previous declaration on li
ne 6 of "strcpy1.c".
"strcpy1.c", line 9.6: 1506-050 (I) Return type "void" in redeclaration is not compatible with the p
revious return type "int".
...全文

相关推荐

评论 10
收藏 已收藏
分享
返回顶部
xadm1986
C语言 70,039 成员 243,237 内容