Compare 2 Strings in C
Compare two strings in C : #include < stdio.h > #include < string.h > #include < stdbool.h > int main () { char str1 [] = " ABC " ; char str2 [] = " ABC " ; bool res ; int i = 0 ; while ( str1 [ i ] != ' \0 ' && str2 [ i ] != ' \0 ' ) { if ( str1 [ i ] == str2 [ i ]) res = false ; else res = true ; i ++; } printf ( " %d \n " , res ); return 0 ; } Related Posts : basic-input/output-c-program Check a Prime Number Array in C Swap 2 Numbers Loops in C Reverse String in C