Why does my code not loop back to the start when "namechange" = 0. The code just stops after it outputs "Here you will be able to start your very own business! Making your own ice cream shop."
int main()
{
string name;
int namechange;
int y;
int n;
int decision;
cout << "******************************************************";
cout << " Welcome to Ice Cream Tycoon!" << endl;
cout <<"*******************************************************";
cout << "Here you will be able to start your very own business! Making your own ice cream shop." << endl;
while (decision = 0) //Loop for name change
{
cout << endl;
cout << "To begin please enter your name" <<endl;
cout << "Hello " << name <<endl;
cout << "Would you like to change your name?" << endl;
cout << "Enter Y to change name. Enter N to continue." << endl;
if (namechange == y)
decision = 0;
else if (namechange == n)
decision = 1;
}
Changed == into = but still doesn't fix the code stopping after "Here you will be able to start your very own business! Making your own ice cream shop."