Hi, I have an assignment where I need to take a string and display it in reverse order and then convert anything in upper case to lower case and vis versa. I have the first piece of the code, but I'm not sure where to begin with the second piece. I know there is a toupper and tolower and even a transform I just cant figure out how to use it...Can someone give me a clue please...I've seen some other post where toupper and tolower is used but it seems to be for just one character, so I can't make it work in my code
// ReverseString.cpp : main project file.
#include "stdafx.h"
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
const string hello("Hello, how are you?");
string s(hello.begin(),hello.end());
// iterate through all of the characters
string::iterator pos;
for (pos = s.begin(); pos != s.end(); ++pos)
{
cout << *pos;
}
cout << endl;
// transform(s.begin(),s.end(),s.end(),tolower);
reverse (s.begin(), s.end());
cout << "reverse: " << s << endl;
}