I wrote this code to change all lowercase letters in a string to uppercase. That works, but I also want it to go the other way around and nothing I tried is working.
#include<iostream>
#include<string>
#include<cctype>
using namespace std;
string change();
int main()
{
change();
return 0;
}
string change()
{
cout << "Enter a string: ";
string s;
getline(cin,s);
int i=0;
while(i<s.length())
{
s.at(i)=toupper(s.at(i));
i++;
}
cout << s << endl;
return s;
}