I am writing this function on changing character strings to either all uppercase or all lowercase. I am supposed to return wether or not a change was made. I am to recieve a string to change and number flag (myChangeType) to tell whether to change to capitals (eToUpper) or lowercase (eToLower)
* Use the flag (myChangeType) to record whether or not any changes
* were made.
* myChangeType=eFalse means no change was made.
* myChangeType=eTrue means a change was made.
heres what i have so far... i dont know how to use the flag ...any help would be appreciated
Code:int myStrChangeCase(unsigned char first_string [], myChangeType name) { int i; int myChangeType; /* Lowercase to Uppercase */ for(i=0; first_string[i] !='\0'; i++); { if( first_string[i] >= 'a' && first_string[i] <='z') first_string[i]= first_string[i] - (32); } /* Uppercase to Lowercase */ for(i=0; first_string[i] !='\0'; i++); { if( first_string[i] >= 'A' && first_string[i] <='Z') first_string[i]= first_string[i] + (32); } return myChangeType; }