For some reason when I input 'y' it runs the if statement as intended but when I input something else, to trigger the else statement it runs the if statement instead. Can someone help point out my error?
int choice;
char depo;
while (1)
{
cout << "Total Balance: $" << totalWinnings << endl;
if (totalWinnings == 0)
{
cout << "Looks like your outta chips! Would you like to make a deposit? (y or n)" << endl;
cin >> depo;
if (depo='y')
{
cout << "Please enter the amount you would like to deposit: ";
cin >> deposit;
totalWinnings += deposit;
cout << "$" << deposit << " Has been credited to your account." << endl;
}
else
cout << "Goodbye!" << endl;
}