我遇到两个错误:
在函数“ int_cdecl invoke_main(void)”(?invoke_main @@ YAHXZ)中引用的未解析的外部符号_main
1个未解决的外部因素
尝试重组正在使用的ATM之后,我完全陷入困境。
#include <iostream>
#include <string>
using namespace std;
int option;
int fundsToWithdraw;
int additionalTransaction;
float balance = 1000;
void print_menu(void) {
cout << "1. Withdrawal Funds/n" << endl;
cout << "2. Check Balance/n" << endl;
cout << "3. Account Details/n" << endl;
cout << "4. Exit" << endl;
cin >> option;
}
void menu() {
switch (option) {
case 1:
cout << "Enter amount to withdraw: £ ";
cin >> fundsToWithdraw;
if (fundsToWithdraw > balance) {
cout << "Insuffient Funds";
cout << "\n\n Do you want another transaction?\nPress 1 to continue";
cin >> additionalTransaction;
if (additionalTransaction == 1) {
print_menu();
}
}
else {
balance = balance - fundsToWithdraw;
cout << "Withdraw £" << fundsToWithdraw << "Your balance after withdrawal: £" << balance;
cout << "\n\n Do you want another transaction?\nPress 1 to continue, ";
cin >> additionalTransaction;
if (additionalTransaction == 1) {
print_menu();
}
}
int main(); {
}
}
}