#include<stdio.h>
int strcmp(char *source, char *dest)
{
int m,n,i,flag;
m = strlen(source);
n = strlen(dest);
if(m!=n)
flag = -1;
if(source==NULL&&dest==NULL)
{
flag = 0;
}
if(source!=NULL&&dest!=NULL)
{
while(*source==*dest&&*source!='\0')
{
source+
不使用库函数,编写函数int strcmp(char *source, char *dest) 相等返回0,不等返回-1;
最新推荐文章于 2024-06-11 12:35:59 发布
#includeint strcmp(char *source, char *dest){ int m,n,i,flag; m = strlen(source); n = strlen(dest); if(m!=n) flag = -1; if(source==NULL&&dest==NULL) { fl
摘要由CSDN通过智能技术生成