invalid conversion
<p>So This is the code i have for my lottery application but my compiler always tells me this when i compile...</p>

<p>Compile errors: </p>

<pre><code>lab6.cpp: In function ‘int main()’:
lab6.cpp:36: error: invalid conversion from ‘int’ to ‘int*’
lab6.cpp:36: error:   initializing argument 2 of ‘int generateRandomNumber(int*, int*)’
lab6.cpp: In function ‘void generateRandomTicket(int*)’:
lab6.cpp:54: error: invalid conversion from ‘int’ to ‘int*’
lab6.cpp:54: error:   initializing argument 2 of ‘int generateRandomNumber(int*, int*)’
lab6.cpp: In function ‘int generateRandomNumber(int*, int*)’:
lab6.cpp:62: error: invalid conversion from ‘int*’ to ‘int’
lab6.cpp:62: error:   initializing argument 3 of ‘bool isNumberTaken(int, int*, int)’
</code></pre>

<p>Here is my code: </p>

<pre><code>//iostream and string are needed for our i/o

#include &lt;iostream&gt;

#include &lt;string&gt;
// cstdlib and ctime are needed for random number generation
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

using namespace std;

const int TopNumber = 25;
const int NumPicks = 4;
const int TicketPrice = 1;
const int TopPrize = 5000;
const int SecondPrice = 500;
const int ThirdPrize = 25;
const int FourthPrize = 10;
const int FifthPrize = 1;

void setup();
void playerTicketSelection(int ticket[]);
void generateRandomTicket(int ticket[]);
int generateRandomNumber(int takenSoFar[], int numTakenSoFar[]);
bool isNumberTaken(int num, int takenSoFar[], int numTakenSoFar);
int checkTicket(int ticket[], int winners[], int bonusNumber);
int computeWinnings(int numCorrect, bool bonus);
void displayWinnings(int amountWon);

int main()
{
   int playerTicket[4], winningNumbers[4];
   int bonusNumber, winnings;

   setup();

   playerTicketSelection(playerTicket);
   generateRandomTicket(winningNumbers);
   bonusNumber = generateRandomNumber(winningNumbers, 4);
   winnings = checkTicket(playerTicket, winningNumbers, bonusNumber);
   displayWinnings(winnings);
   return 0;
}

void setup()
{
   cout &lt;&lt; "welcome to the " &lt;&lt; 4 &lt;&lt; "/";
   cout &lt;&lt; 25 &lt;&lt; " Lottery, where you try to match" &lt;&lt; endl;
   cout &lt;&lt; "   " &lt;&lt; 4 &lt;&lt; " numbers in the range 1-";
   cout &lt;&lt; 25 &lt;&lt; endl;
   cout &lt;&lt; endl;
   srand(time(NULL));

}

void generateRandomTicket(int ticket[])
{
   for (int i=0; i&lt;4; i++) {
      ticket[i] = generateRandomNumber(ticket, i);
   }
}

int generateRandomNumber(int takenSoFar[], int numTakenSoFar[])
{
   int numPicked = 0;
   do {
      numPicked = 1+(rand() % 25);
   } while (isNumberTaken(numPicked, takenSoFar, numTakenSoFar));
   return numPicked;
}

void playerTicketSelection(int ticket[])
{
   cout &lt;&lt; endl &lt;&lt; "Please select " &lt;&lt; 4;
   cout &lt;&lt; " different numbers in the range 1 - ";
   cout&lt;&lt; 25 &lt;&lt; endl &lt;&lt; endl;
   int numChosen = 0;
   do {
      int choice;
      cout &lt;&lt; "Enter your next choice: ";
      cin &gt;&gt; choice;
      if ((choice &lt; 1) || (choice &gt; 25)) {
         cout &lt;&lt; "Your choice must be in the range 1 - ";
         cout &lt;&lt; 25 &lt;&lt; endl;
      } else if (isNumberTaken(choice, ticket, numChosen)) {
         cout &lt;&lt; "You have already chosen that number" &lt;&lt; endl;
      } else {
         ticket[numChosen] = choice;
         numChosen++;
      }
   } while (numChosen &lt; 4);
   cout &lt;&lt; "Your chosen numbers are: ";
   for (int i = 0; i &lt; 4; i++) {
      cout &lt;&lt; ticket[i] &lt;&lt; " ";
   }
   cout &lt;&lt; endl &lt;&lt; endl;
}

bool isNumberTaken(int num, int takenSoFar[], int numTakenSoFar)
{
   bool taken = false;
   for (int i = 0; i &lt; numTakenSoFar; i++) {
      if (num == takenSoFar[i]) {
      taken = true;
      }
   }
   return taken;
}

int checkTicket(int ticket[], int winners[], int bonusNumber) {
   int correct = 0;
   int winnings = 0;
   bool bonus = false;
   for (int playerNum = 0; playerNum &lt; 4; playerNum++) {
       if (bonusNumber == ticket[playerNum]) {
          bonus = true;
       } else if (isNumberTaken(ticket[playerNum], winners, 4)) {
          correct++;
       }
   }
   cout &lt;&lt; "The numbers drawn were: ";
   for (int i = 0; i &lt; 4; i++) {
       cout &lt;&lt; winners[i] &lt;&lt; " ";
   }
   cout &lt;&lt; ", bonus number: " &lt;&lt; bonusNumber &lt;&lt; endl &lt;&lt; endl;
   cout &lt;&lt; "You matched " &lt;&lt; correct &lt;&lt; " of the ";
   cout &lt;&lt; 4 &lt;&lt; " numbers drawn";
   if (bonus) {
      cout &lt;&lt; " plus the bonus number";
   }
   cout &lt;&lt; endl;
   winnings = computeWinnings(correct, bonus);
   return winnings;
}

int computeWinnings(int numCorrect, bool bonus) {
   int winnings = 0;
   if (numCorrect == 4) {
      winnings = 5000;
   } else if ((numCorrect == (4 - 1)) &amp;&amp; bonus) {
      winnings = 500;
   } else if (numCorrect == (4 - 1)) {
      winnings = 25;
   } else if ((numCorrect == (4 - 2)) &amp;&amp; bonus) {
      winnings = 10;
   } else if (numCorrect == (4 - 2)) {
      winnings = 1;
   }
   return winnings;
}

void displayWinnings(int amountWon) {
   cout &lt;&lt; "Your $" &lt;&lt; 1 &lt;&lt; " ticket has won $";
   cout &lt;&lt; amountWon &lt;&lt; endl &lt;&lt; endl;
   cout &lt;&lt; "Thanks for playing!" &lt;&lt; endl &lt;&lt; endl;
}
</code></pre>

<p>Can someone tell me what the problem with the code is ? i cant seem to understand what the compiler error means. </p>
