C语言的问题(新手提问)
帮忙看一下这个程序问题出在哪?
#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".
#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".
...全文


