#include <iostream>

using namespace std;

//-----------------------------------------------------------------------------
void UserMove(int &NumStones)
/* Pre: NumStones > 0
 Post: User has taken 1, 2, or 3 stones from pile */
{
 cout << "How many would you like? ";
 int TakeStones;
 cin >> TakeStones;
 while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones) {
  cout << "Value must be between 1 and 3" << endl;
  cout << "How many would you like? ";
  cin >> TakeStones;
 }
 NumStones-=TakeStones;
}
//-----------------------------------------------------------------------------
void ComputerMove(int &NumStones)
/* Pre: NumStones > 0
 Post: Computer has taken 1, 2, or 3 stones from pile */
{
 int TakeStones;
 do {
  TakeStones=1+random(3);
 } while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones);
 cout << "The computer takes " << TakeStones << "." << endl;
 NumStones-=TakeStones;
}

int main()
{
    UserMove();
    ComputerMove();
    system("PAUSE");
    return 0;
}
#include <iostream>

using namespace std;

//-----------------------------------------------------------------------------
void UserMove(int &NumStones)
/* Pre: NumStones > 0
 Post: User has taken 1, 2, or 3 stones from pile */
{
 cout << "How many would you like? ";
 int TakeStones;
 cin >> TakeStones;
 while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones) {
  cout << "Value must be between 1 and 3" << endl;
  cout << "How many would you like? ";
  cin >> TakeStones;
 }
 NumStones-=TakeStones;
}
//-----------------------------------------------------------------------------
void ComputerMove(int &NumStones)
/* Pre: NumStones > 0
 Post: Computer has taken 1, 2, or 3 stones from pile */
{
 int TakeStones;
 do {
  TakeStones=1+random(3);
 } while (TakeStones<1 || TakeStones>3 || TakeStones>NumStones);
 cout << "The computer takes " << TakeStones << "." << endl;
 NumStones-=TakeStones;
}

int main()
{
    UserMove();
    ComputerMove();
    system("PAUSE");
    return 0;
}

Function in line 6 expects a parameter. Your function call does not provide one in line 35. Same thing for your function call in line 36. you need to define an integer in main, then pass that integer to each function in your function calls. Initialize this variable to be the number of stones that exists before the game starts, then call your functions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.