I am writng a fucntion that Compares two strings alphabetically, case-INsensitive.
The instructions are :
* Copy the two strings to local buffers (arrays), change both string *COPIES to upper case; Compare the two strings using myStrCmp().
is what i have
int myStrBlindCmp(unsigned char change_one, unsigned char change_two)
i know that to change to uppercase would look like this:
and myStrCmp looks like this:
// To Uppercase
for ( x=0; string[x] != '\0'; ++x)
if ( string[x] >= 'a' && string[x] <= 'z')
string[x] = string[x] - (32);
but how do you copy to local buffers and put this all together???
int myStrCmp (unsigned char one,unsigned char two)
while (one[i]==two[i] && one[i] != '\0' && two[i] != '\0')
if (one[i] == '\0' && two[i] =='\0')
if (one[i] > two[i] )