C challenge

+1 Danny AA · January 8, 2015
Hello,
I'm trying to make a recursion func that gives me first letter as uppercase and the rest lowercase
I need with that pls.

// uppercase func
char Uppercase(char* first_letter)
{
int i = 0;
char ch;
if (first_letter[0] == '\0')
return 0;
if (first_letter[0] >= 97)
return Uppercase(first_letter)+getSmallLetter(ch);

}



// small letter func
char getSmallLetter(char ch)
{
if (ch >= 'A' && ch <= 'Z')
ch += 'a' + 'A'; // change big letter to a small letter
return ch; // return small letter
}

Post a Reply

Replies

Oldest  Newest  Rating
0 c student · January 8, 2015
i can see a few errors there already, but first, could you quickly brief us on what you know about strings and recursion?
0 Danny AA · January 8, 2015
I found my mistake, thanks!!!
  • 1

C

107,251 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator