ch 10/p104.c
//Function to compare two strings for equality

Function to compare two strings for equality
Function to compare two strings for equality
bool equalStrings ( const char string1 [], const char string2 [] )
	{
		bool is_equal ;
		int i = 0;
		while ( string1 [i] == string2 [i] && string1 [i] != '\0' && string2 [i] != '\0' )
			i++ ;
		if ( string1 [i] == '\0' && string2 [i] == '\0' )   
			is_equal = true ;								
		else
			is_equal = false ;
		return is_equal ;
	}
bool equalStrings ( const char string1 [ ] , const char string2 [ ] ) { bool is_equal ; int i = 0 ; while ( string1 [ i ] == string2 [ i ] && string1 [ i ] != ' \0 ' && string2 [ i ] != ' \0 ' ) i ++ ; if ( string1 [ i ] == ' \0 ' && string2 [ i ] == ' \0 ' ) is_equal = true ; else is_equal = false ; return is_equal ; }
Function to compare two strings for equality
Function to compare two strings for equality
//Flag to return the result
 //Loop to iterate over chars in both strings until either the chars are different or one of the strings ends
 //Check to establish equality after loop terminates by evaluating reason for termination
 //Only way the strings can be equal is if both the strings reached till null and the null is at the same place
 //in the array
