看看这个C程序哪错啦?怎么一运行就出错误

来源:百度知道 编辑:UC知道 时间:2024/09/24 10:40:10
不用字符串copy函数实现字符串复制
#define N 20
#include <stdio.h>
char cpy(char *p,char *q); 这样写成吗void cpy(char *p,char *q);)
main()
{
char sour[N],dest[N],*p=sour,*q=dest;
printf("enter ...\n");
scanf("%s",sour);
cpy(*p,*q);
printf("sour:%s",sour);
printf("dest:%s",dest);
}
char cpy(char *p,char *q) 下面也是void ....
{
int i=0;
while(*(p+i)!='\0')
{
*(q+i)=*(p+i);
i++;
}
}

#定义ñ 20

#包括<stdio.h>

焦炭cpy (焦*磷,炭* Q )的;这样写成吗无效cpy (焦*磷,炭* Q )的; )

主要( )



炭酸的[ ] , dest的[ ] , * P值酸, *为Q = dest ;

printf函数( “输入... \ ñ ” ) ;

scanf ( “ % s ”图片,酸奶) ;

cpy ( *磷, * Q )的;

printf函数( “酸奶: % s ”图片,酸奶) ;

printf函数( “ dest : % s的” , dest ) ;



焦炭cpy (焦*磷,炭* Q )的下面也是无效的....



整数字母i = 0 ;

而( * ( p + 1 ) ! = ' \ 0 ' )



* ( q +一) =* ( p + i )段;

一+ + ;