Code:
#include <algorithm>
#include <string>
#include <iostream>
#include <cctype>
struct to_lower { //Omg a class :D
int operator() ( int ch )
{
return std::tolower ( ch ); //Return value of tolower :D
}
};
struct to_upper { //Omg a class thing :D
int operator() ( int ch )
{
return std::toupper ( ch );
}
};
int main()
{
std::string hello;
std::cout<<"Hi Their, Please input anything you want:";
getline(std::cin,hello);
std::cout<<"Before: "<< hello <<'\n';
std::transform(hello.begin(), hello.end(), hello.begin(), to_lower());
std::cout<<"After conversion to lower: "<< hello <<'\n';
std::transform(hello.begin(), hello.end(), hello.begin(), to_upper());
std::cout<<"After conversion to upper: "<< hello <<'\n';
getchar();
}
Got something to work