1. you don't need two strings, you can just modify the input string.
2. i don't get what the four integers are for
3. you don't need all the casts in:
Code:
if ( String[0] >= (char)97 || String[0] <= (char)122)
there is a logical error in there too, the two clauses should be connected with AND
avoid magic numbers too while ur at it:
Code:
if (String[0] >= 'a' && String[0] <= 'z')
or better still:
Code:
if (islower(String[0]))
simpler still (since toupper() doesn't do anything if the character is already in uppercase):
the whole if could be replaced by:
Code:
String[0] = toupper(String[0]);
4. I'm clueless about whats happening here:
Code:
String[0] = (char)x;
x - 32 == y;
String[0] = (char)y;
did you mean:
?
5. why have different lengths for the two strings?