Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void convertCase(string &text)
- {
- unsigned d = text.size();
- cout << &text << endl;
- for(unsigned i = 0; i < d; ++i)
- {
- if(text[i] >= 'A' && text[i] <= 'Z')
- text[i] += 32;
- else if(text[i] >= 'a' && text[i] <= 'z')
- text[i] -= 32;
- }
- }
- int main()
- {
- string tekst = "Ala ma Kota";
- cout << &tekst << endl;
- cout << tekst << endl;
- convertCase(tekst);
- cout << tekst << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment