0

Two Errors i'm getting:

unresolved external symbol _main referenced in function "int_cdecl invoke_main(void)"(? invoke_main@@YAHXZ)

1 unresolved externals

I'm completely stuck after trying to restructure the ATM i'm working.

#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(); {

        }



    }
}
NRM_
  • 1

0 Answers0