I find a code that sorting the names and at this program shouldnt be difference Between "a" and "A"
and my Question is what does line 20 said ..!?
#include <iostream>
#include <string.h>
#define MAXNAMES 100
using namespace std;
int compare(string s1, string s2){
int i;
for ( i = 0; s1[i] && s2[i]; ++i)
{
/* If characters are same or inverting the 6th bit makes them same */
if (s1[i] == s2[i] || (s1[i] ^ 32) == s2[i])
continue;
else
break;
}
/* Compare the last (or first mismatching in case of not same) characters */
if (s1[i] == s2[i])
return 0;
if ((s1[i]|32) < (s2[i]|32)) //Set the 6th bit in both, then compare
return -1;
return 1;
}