Error "in function 'main' syntax error before 'int' Help Please
i have a dice game im making to start out in C and i keep getting this error
Error "in function 'main' syntax error before 'int'
Whats wrong with it?
Code:
#include <stdio.h>
#include <conio.h>
int RollDice(void);
int main(void)
{
int numbGuess, userGuess, exitVal, diceRoll;
exitVal = 0;
numbGuess = 0;
diceRoll = RollDice();
do{
printf("Welcome To The Dice Game!\n");
printf("You Have 5 Guesses To Pick The Right Number!\n");
printf("Please Enter Your Guess For the Dice(E.x 1-6): ");
scanf("%d", &userGuess);
numbGuess++;
if(userGuess == diceRoll)
{
system("cls");
printf("You WIN!!!!\n");
printf("Number Of Guesses: %d", numbGuess);
exitVal = 1;
}else
{
printf("Try Again. Press Enter To Put In A New Guess...");
getch();
system("cls");
numbGuess++;
}
if(numbGuess > 4)
{
printf("To Many Guesses Game Over.");
}while(exitVal == 0);
getch();
return 0;
}
int RollDice(void)
{
srand(time(NULL));
int Roll;
Roll = 1 + rand() % 6;
return Roll;
}