I'm trying to have a string only work if it matches an int in the list.
Code
int Keys[] = { 23454563, 1262352, 634261253, 152352 };
string key;
int main()
{
cout << ("Please Enter Key: ");
cin >> key;
if (key = Keys)
{
//Activate Code
}
else
{
//Don't activate
}
}
I've tried searching around and I can't find any valid methods. I did try
if (sscanf(key.c_str(), "%d", &Keys) == 1)
^this works, but any number works and that isn't what I'm looking for.