我在第 34 行收到一个错误,说有一个“在 'void' 之前的预期表达式”(或 int,如果我更改函数类型,我不确定它应该是哪个)。我不知道如何解决这个问题。
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Declare Function Prototypes
void PlayingDice(void);
void GuessNumber(void);
int main (void)
{
// Loop so games can be replayed
do
{
// Introducing Games
int game, UserGuessDice, UserGuessNumber, die1, die2, sum, number;
printf("Do you want to (1) play dice, (2) guess the number, or (3) exit program?\n");
scanf("%d", &game);
printf("You have selected %d.\n", game);
if (game==1)
{
// Calls Playing Dice Game
printf("%d", void PlayingDice(void));
}
else if (game==2)
{
// Calls Guess Number Game
printf("%d", void GuessNumber(void));
}
else
{
// In case user enters invalid option
printf("That wasn't an option!\n");
}
}
while (game != 3);
// End Program
printf("Good bye.\n");
return (0);
}