//enemy.cpp
int encounter1 (int hp, int ammo)
{
//...
//...
//...
return hp;
return ammo;
}
//main.cpp
//...
int main ()
{
//These are going to be assigned values later
int hp, ammo;
//...
cout << "Do you want to fight? (Y/N)" << endl;
cin >> choice;
if (choice == 'Y')
{
encounter1 (hp, ammo);
cout << "HP remaining : "
<< hp
<< endl;
cout << "Ammo remaining: "
<< ammo
<< endl;
}
else
{
return 0;
}
But hp and ammo stay same, as initialized in main.cpp. I deduce that they aren't returning properly, or idk how to return multiple variables. Help please.