Expected Primary Expression before void ??

Expected Primary Expression before void ?? Actually , could anyone here help me please with this code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
  #include<iostream>
#include<stdio.h>
#include<string>

using namespace std;

void screen1()
{
     cout<<"\n\t\t\tTechnoSapiens Industry \n\t\t\t\tpresents";
    cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl<<"\t\t\t";
    system("pause");
}

void screen2()
{
     system("cls");
    cout<<"\n\n\n\n\n\n\n\n\n\n\n\t\t\t\tDECEPTION";
    cout<<endl<<endl<<endl<<endl<<endl<<"\t\t\t";
    system("pause");
}

void screen3()
{
     system("cls");
    cout<<"TSI presents...\n\nDECEPTION";
    cout<<"\n\n\n\t\t1.Play\n\n\t\t2.Instructions\n\n\t\t3.Options\n\n\t\t4.Exit Game";
    cout<<"\n\n\nYour Choice  :  ";
}

void invalid_request()
{
     cout<<"\n\nInvalid Request..."<<endl<<endl<<endl;
}

void age()
{
      int age;
      cout<<"\n\n\t\t\tAGE          :  ";
      cin>>age;
      if(age >=1 && age <=100)
      {
             return;
      }
      else
      {
             invalid_request();
             return;
      }
}


void gender()
{
     char gender;
     cout<<"\n\n\t\t\tGENDER (M/F) :  ";
     cin>>gender;
     if(gender == 'M' || gender == 'm' || gender == 'F' || gender == 'f')
     {
               age();
     }
     else
     {
               invalid_request();
               return;
}

void name()
{
     cout<<"Enter Your Personal Details : ";
     cout<<endl<<endl<<endl;
     std::string name;
     cout<<"Name : ";
     std::getline(std::cin, name);
     gender();
}

void exit_game()
{
     cout<<endl<<endl<<endl<<"Exiting game...";
}

int main()
{
    screen1();
    screen2();
    screen3();
    int prompt;
    cin>>prompt;
    switch(prompt)
    {
                   case 1 : name(); break;
                   case 2 : break;
                   case 3 : break;
                   case 4 : exit_game(); break;
                   default : cout<<"\n\nInvalid Request..."<<endl<<endl<<endl;system("pause");
    }
    system("pause"); 
    return 0;
}
Your void gender() function is missing a } brace
Count opening and closing brackets in your gender function.
you forgot a closed brais }
Topic archived. No new replies allowed.