streql.c
来自「C语言经典程序的源码对初学者很有用,内容涉及面广」· C语言 代码 · 共 20 行
C
20 行
#include <stdio.h>
int streql(char *str1, char *str2)
{
while ((*str1 == *str2) && (*str1))
{
str1++;
str2++;
}
return((*str1 == NULL) && (*str2 == NULL));
}
void main(void)
{
printf("Testing Abc and Abc %d\n", streql("Abc", "Abc"));
printf("Testing abc and Abc %d\n", streql("abc", "Abc"));
printf("Testing abcd and abc %d\n", streql("abcd", "abc"));
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?