Indeed there is, im not thinking straight as im falling asleep but anyway you could use something like this.
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
string stripcase(string instring){
string buffer = "";
for(int i = 0; i < instring.length(); i++){
buffer += tolower(instring[i]);
}
return buffer;
}
int main()
{
string input1 = "winSton Chruchill"; //this would be set via user input of course, just an example
string correct1 [2] = {"Winston Churchill", "Chruchill"};
for(int i = 0; i < 2; i++)
{
if(stripcase(correct1[i]) == stripcase(input1)){
cout << "Congratulations, you got it!";
}
}
return 0;
)
Something like that is what your after, there are probably better ways but i cannot thing straight right now, im gonna shoot off anyway so if you need it explaining then im sure one of the other guys will help. If not i will when im next online.
I recomment reading up on cctype as this will help you understand what is going on, also you should be aware that you are able to treat strings as char arrays, these will help you understand this.
buffer += tolower(instring[i]);
Cheers,
Chris