Is there some reason why i can only do very simple math in a C++ function? and no math whatsoever involving new variables within that function?
#include <iostream>
using namespace std;
int test(int evasion, int acc);
int main()
{
int evasion = 200;
int acc = 185;
int combo = test(evasion,acc);
cout << combo << "\n\n";
system("PAUSE");
return 0;
}
int test(int evasion, int acc)
{
int total = evasion + acc;
int average = 100;
int acc2 = acc;
// next few lines are my test code
if ( evasion == 200 && acc == 185 && average == 100) {
total = acc2 / total;
return total;
} else {
cout << "FAIL";
system("PAUSE");
return 0;
}
// int total2 = evasion / total;
// return total2;
}
Above code returned 0.