jeudi 21 mars 2019

upper case function C++

I am having problems with my convert String to upper case function. I have two functions right now reverse word and Upper case. reverse currently works and outputs information backwards but for some reason, uppercase wont. I have a menu which allows users to input a word then choose to either reverse or change it to uppercase

here is a snippet of code for the uppercase function.

string Upperword(string originalString){
    string localString;
  int len = originalString.length();

  for (int i = 0 ; i << len; i++)

 localString = toupper(originalString[i]);

  return localString;

}

anyone know why it wont output the word in uppercase format ?

Aucun commentaire:

Enregistrer un commentaire