STREQL.C
资源名称:C.rar [点击查看]
上传用户:qq5388545
上传日期:2022-07-04
资源大小:29849k
文件大小:0k
源码类别:

界面编程

开发平台:

C/C++

  1. #include <stdio.h>
  2. int streql(char *str1, char *str2)
  3.  {
  4.    while ((*str1 == *str2) && (*str1))
  5.      {
  6.        str1++;
  7.        str2++;
  8.      }
  9.    return((*str1 == NULL) && (*str2 == NULL));
  10.  }
  11. void main(void) 
  12.  {
  13.    printf("Testing Abc and Abc %dn", streql("Abc", "Abc"));  
  14.    printf("Testing abc and Abc %dn", streql("abc", "Abc"));  
  15.    printf("Testing abcd and abc %dn", streql("abcd", "abc"));  
  16.  }