Im trying to make an annogram. first you input a word, and then it mixes it up and then couts the scrambled version of the word. My problem right now is that when you input a word like "Cat", it will mix up and look like "aCt" or something with the "C" and "at". If you type in "cat" it says you are wrong, because you have to capitalize c. I'm trying to get it to automatically convert any input that is capitalized into lowercase. Here's my code sofar, and I have NO idea how to create lowercase
//---------------------------------------------------------------------------
#include <iostream.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#pragma argsused
string scrambbledword;
string originalword;
void shufflefunction(){
cout << "Please enter a word to be shuffled "<<endl;
cin >> originalword;
srand (time (NULL));
scrambbledword=originalword;
random_shuffle (scrambbledword.begin(), scrambbledword.end());
cout << scrambbledword <<endl;
cout << "Guess the original word" <<endl;
}
int main(int argc, char* argv[])
{
string guess;
int count = 3;
shufflefunction();
while (count!=0){
cin >> guess;
if ( guess==originalword){
cout<<"correct" <<endl;
shufflefunction();
}else if(guess!=originalword){
count --;
cout << "Incorrect" << endl;
}
}
getch();
return 0;
}
//---------------------------------------------------------------------------
any help would be appreciated