编程实现strcpy.strcat.strlen.用指针
1个回答
2013-12-23
展开全部
char* strcpy(char* to, char* from)
{
char* p = to;
while(*to++ = *from++);
return p;
}
char* strcat(char* a, char* b)
{
char* p = a;
while(*a)++a;
while(*a++ = *b++);
return p;
}
int strlen(char* a)
{
int len = 0;
while(*a++)++len;
return len;
}
{
char* p = to;
while(*to++ = *from++);
return p;
}
char* strcat(char* a, char* b)
{
char* p = a;
while(*a)++a;
while(*a++ = *b++);
return p;
}
int strlen(char* a)
{
int len = 0;
while(*a++)++len;
return len;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询