Can anyone tell me why this doesn't work?
MainGame.cpp
Code:
#include <iostream>
#include "functions.h"
using namespace std;
int main()
{
int attack;
Leviathan(attack);
cout << "Attack: " <<attack << endl;
system("pause");
return 0;
}
functions.h
Code:
int Leviathan(int attack);
MonsterList.cpp
Code:
int Leviathan(int attack)
{
attack = 5;
return attack;
}
I'm trying to get attack to return from MosterList.cpp to MainGame.cpp as 5.
But it is always 0.
How do I get it to return what I changed in the MonsterList.cpp?