Hi guys, I'm trying to write a function that could convert a lowercase string to uppercase. Not sure if I'm heading the right direction.
Essentially the function
ToUpperString (char s[]);
would convert everything in the string to the uppercase equivalent.
Here's what I got so far:
void ToUpperString ( char s[] )
{
static char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
static char lower[] = "abcdefghijklmnopqrstuvwxyz";
for ( int i = 0; lower[i] != '\0'; i++ ) {
if ( ch == lower[i] )
return upper[i];
}
return char s[];
}
Please tell me if I'm going the right direction, any help is greatly appreciated.