fork download
  1. #include <iostream>
  2.  
  3. void toUpper( char array[] ); //or *array
  4.  
  5. int main()
  6. {
  7. using std::cout;
  8. using std::endl;
  9.  
  10. char array[6] = "Hello"; //by default it should append the null since I used double
  11. //quoteswhich indicates it is a string and is not an ordinary array
  12.  
  13. toUpper( array );
  14.  
  15. cout << array << endl;
  16. }
  17.  
  18. void toUpper( char array[] )
  19. {
  20. for( int i = 0; array[i]; ++i )
  21. array[i] = toupper(array[i]); //http://w...content-available-to-author-only...s.com/reference/cctype/toupper/?kw=toupper
  22. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
HELLO