- #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 %dn", streql("Abc", "Abc"));
- printf("Testing abc and Abc %dn", streql("abc", "Abc"));
- printf("Testing abcd and abc %dn", streql("abcd", "abc"));
- }