im having a bit of trouble with this for loop. can somone show me what im doing wrong?
runcount = runcount + 1;
cout << "Type a number: \n";
cin >> s;
guesssheet[runcount] = s;
for(int y = 0; y < runcount; ++y)
{
if(guesssheet[y] = s)
{
system("cls");
cout << "Sorry, you have already guessed that number. try again.\n\n";
GetResults();
}
}
and this is the error i get:
165 C:\Dev-Cpp\Examples\Jackpot\main.cpp could not convert `((+(((unsigned int)y) * 4u)) + ((std::string*)(&guesssheet)))->std::basic_string<_CharT, _Traits, _Alloc>::operator= [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)(&s))))' to `bool'
so am i doing somthing wrong?