Help

assignment of mine. need help in line 26. i dont know what to do with it
how do you convert a string to lower case and upper case and vice versa?
main functiong should not be edited

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <string>
using namespace std;

string askString(string s);
string reverseCase(string s);

int main(){

string s;

//this function asks a string from the user
askString(s);

//this function converts small letters to capital, and capital to small
reverseCase(s);

return 0;
}
 
string askString(string s){
	cout << "Type a string: ";
		cin >> s;
}

string reversCase(string s){
	if(s[i] >= 'a' && s[i] <= 'z'){
    //s[i] is lowercase
}
	else if(s[i] >= 'A' && s[i] <= 'Z'){
    //s[i] is captial
}
}
Last edited on
Topic archived. No new replies allowed.