missing function header (old-style formal list?)

Hey you guys...I'm having trouble getting this problem to run...any help???

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
#define WINSCORE 3

char PickRandomOption (void);
{
char option;
srand ( time_t (NULL) );
int value = rand()%3;

switch (value) // It occurs here at line (10)
//error C2447: '{' : missing function header
//(old-style formal list?)
{
case 0: option='s'; break;
case 1: option='x'; break;
case 2: option='p'; break;
}
return option;
}


int WhoWins (char a, char b)
{
switch (a)
{
case 's':
if (b=='x') return 1;
else if (b=='p') return 2;
else return 0;
case 'x':
if (b=='p') return 1;
else if (b=='s') return 2;
else return 0;
case 'p':
if (b=='s') return 1;
else if (b=='x') return 2;
else return 0;
default:
return -1;
}

}

int main ()
{
char you, me;
int mypoints=0;
int yourpoints=0;
int winner;

do {
cout << "\nEnter s, x or p ";
cout << "(s=stone, x=scissors, p=paper): ";
cin >> you;

me = PickRandomOption();
cout << "I say: " << me << "\n";

winner = WhoWins (you,me);

if (winner==0) cout << "Tied\n";
else if (winner==1) { cout << "You win\n"; yourpoints++; }
else if (winner==2) { cout << "I win\n"; mypoints++; }
else cout << "Sorry. You entered an Invalid option\n";

cout << "POINTS: You:" << yourpoints;
cout << " Me:" << mypoints << "\n";

} while (yourpoints<WINSCORE && mypoints<WINSCORE);

if (yourpoints>mypoints) cout << "You win the competition!\n";
else cout << "I win the competition!\n";
return 0;
}
Extra semicolon:
char PickRandomOption (void);
{
Remove the semicolon from PickRandomOption (void);
THANKS YOU GUYS...:)...
Topic archived. No new replies allowed.