This is a minesweeper game program with the goal of finding 5 bombs by making coordinate guesses: Here's my main function so far. My question is, why do I get an "Undefined symbol 'minefield' " error? (there's about 5 of these errors since there's 5 void functions that have the same parameters) Is this a problem that could be caused by something outside the main function?
Code:
void main()
{
int row,
col,
r1,
c1;
int num_found=0,
num_attempts=0;
bombs_left=5,
bool all_found=false;
char minefield[10][10];
void reset_array(minefield, row, col);
void print_array(minefield, row, col);
void fill_array_with_bombs(minefield, row, col);
system("CLS");
void print_array_without_bombs(minefield, row, col);
cout<<"Time to start sweeping for mines!";
while (row>0 && col>0 && all_found==false)
{
cout<<"Please enter a row and column number: ";
cin>>r1
cin>> c1;
bool check_for_hit();
if (check_for_hit()==true)
{
num_found++;
cout<<"There are now "<<bombs_left--<<"bombs left in the minefield";
if (bombs_left==0)
{
all_found=true;
}
}
num_attempts++;
void print_array_without_bombs(minefield, row, col);
if (all_found==true)
{
cout<<"It took you "<<num_attempts<<" guesses to find all 5 bombs! HAHA!";
}
else
{
cout<<"You quit the program early.";
}
void print_array(minefield, row, col);
}
}