'WinMain@16' error in database program

Trying to get my database program to run but I keep getting the 'WinMain@16' error. I've tried to resolve it through google but no luck.

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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
 #include <iostream>
#include <string>
#include <cstdlib>
#include <windows.h>

using namespace std;

// FUNCTIONS
void mainMenu();
void laptopsMenu();
void pcsMenu();
void tabletsMenu();
void mainn();

//Global Variables
string userOrder = " ";

void mainn ()
{
string personType = " ";

do
{
cout << "Welcome to the Computer Store!" << endl << endl;
cout << "Are you a client or manager?" << endl;
cin >> personType;

if ( personType == "client" )
{
mainMenu();	// Calls Function mainMenu
}

else if ( personType == "manager" )
{
cout << endl << "The client ordered a " << userOrder << "."<< endl << endl;
}
}
while ( personType == "client" || personType == "manager" );

cout << endl << "Thank you for your business. BYE !!! " << endl;

system("pause");
}

//**********************************************************
//	FUNCTIONS
//**********************************************************


//	mainMenu Function
//***************************************
void mainMenu ()
{
int mainMenuOption = 0;

cout << endl << "Computer Menu Options: " << endl;
cout << "1) Laptop." << endl;
cout << "2) PC." << endl;
cout << "3) Tablet." << endl;
cout << "4) Exit." << endl << endl;
cout << "What kind of computer would you like to order?" << endl;
cin >> mainMenuOption;

switch ( mainMenuOption )
{
case 1:
laptopsMenu();	// Calls Function laptopsMenu
break;
case 2:
pcsMenu();	// Calls Function pcsMenu
break;
case 3:
tabletsMenu();	// Calls Function tabletsMenu
break;
default:
cout << "Thank you for your business. BYE !!! " << endl;
break;
}

if ( mainMenuOption == 1 || mainMenuOption == 2 || mainMenuOption == 3 )
{
cout << endl <<"You just ordered a " << userOrder << "." << endl;
cout << "Thank you for your selection." << endl;
cout << "Your order is at the front desk." << endl << endl;
}
}


//	laptopsMenu Function
//***************************************
void laptopsMenu()
{
int laptopsMenuOption = 0;

cout << endl << "Laptop Selection Menu" << endl;
cout << "1) MacBook" << endl;
cout << "2) Asus" << endl;
cout << "3) Dell" << endl;
cin >> laptopsMenuOption;

switch ( laptopsMenuOption )
{
case 1:
userOrder = "Laptop MacBook";
break;
case 2:
userOrder = "Laptop Asus";
break;
case 3:
userOrder = "Laptop Dell";
break;
}

}


//	pcsMenu Function
//***************************************
void pcsMenu()
{
int pcsMenuOption = 0;

cout << endl << "PC Selection Menu" << endl;
cout << "1) Alienware" << endl;
cout << "2) Gateway" << endl;
cout << "3) Dell" << endl;
cin >> pcsMenuOption;

switch ( pcsMenuOption )
{
case 1:
userOrder = "PC Alienware";
break;
case 2:
userOrder = "PC Gateway";
break;
case 3:
userOrder = "PC Dell";
break;
}
}


//	tabletsMenu Function
//***************************************
void tabletsMenu()
{
int tabletsMenuOption = 0;

cout << endl << "Tablet Selection Menu" << endl;
cout << "1) iPad" << endl;
cout << "2) Nexus 7 (Android)" << endl;
cout << "3) Kindle" << endl;
cin >> tabletsMenuOption;

switch ( tabletsMenuOption )
{
case 1:
userOrder = "Tablet iPad";
break;
case 2:
userOrder = "Tablet Nexus 7 (Android)";
break;
case 3:
userOrder = "Tablet Kindle";
break;
}
}
line 18
- main only has one n
- main must return int
Some further reading if you are interested OP: https://msdn.microsoft.com/en-us/library/3ze4ytsc.aspx
Topic archived. No new replies allowed.