fork download
  1. #include <string.h>
  2. #include <ctype.h>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int Mayusculas(char *texto)
  8. {
  9. int liCount;
  10.  
  11. for(liCount=0;liCount<strlen(texto);liCount++)
  12. {
  13. texto[liCount] = (char)toupper(texto[liCount]);
  14. }
  15.  
  16. return liCount;
  17. }
  18.  
  19. int main ()
  20. {
  21. char str[] = "Hello world";
  22. int length = Mayusculas(str);
  23. cout << '"' << str << '"' << ", " << length << " characters." << endl;
  24. return 0;
  25. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
"HELLO WORLD", 11 characters.