Sachees

toupper()

Jul 1st, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. void uppering(std::string &upIt);
  4. int main()
  5. {
  6. std::string word;
  7. for(;;)
  8. {
  9. std::cout << "Nastepny lancuch: ";
  10. getline(std::cin, word);
  11. if(word == "q")
  12. break;
  13. uppering(word);
  14. std::cout << word << "\n";
  15. }
  16. std::cout << "Do widzenia";
  17. return 0;
  18. }
  19. void uppering(std::string &upIt)
  20. {
  21. int i = 0;
  22. while(upIt[i] != NULL)
  23. {
  24. upIt[i] = toupper(upIt[i]);
  25. i++;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment