errors - if else and missing ; syntax error

I'm testing a little bit of this program and I'm at a bit of a loss with a couple of errors that are preventing me from proceeding.
So there's this one : I'm getting a error - C2143: syntax error : missing ';' before '.' - message seeming to come from the BankingSystem.CreateAccount() part
after case 1. I'm also getting a mismatched if else error from another related.cpp code that when I hit go to location it just brings me back to the bottom of this page instead of the other file.
Thanks for any help!
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

#include <iostream>
#include "bankingSystem.h"

//Print a menu of options to the user.

void PrintMenu()
{

    std::cout << "\n(1) Add Account\n";
    std::cout << "(2) Delete Account\n";
    std::cout << "(3) Print Accounts\n";
    std::cout << "(4) Deposit\n";
    std::cout << "(5) Withdrawal\n";
    std::cout << "(6) Exit\n";
    std::cout << "\nEnter selection:  ";

}

//Start your main program loop here.

int main()
{

    //All class functions are called through a BankingSystem object.

    BankingSystem b;
    int selection;

	while (selection <= 6)
	{

      std::cout << "\n*** Welcome to the Banking System ***\n";
	  PrintMenu();
	  std::cin >> selection;

	  switch ( selection )
	  {

	  case 1:
		  BankingSystem.CreateAccount();
		  break;
	  }
	}



    return 0;

}
closed account (Dy7SLyTq)
firstly you need to initialize selection but ill assume its one just to review the program... oh wait... you want a do while loop. not to mention better testing
The line:
 
		  BankingSystem.CreateAccount();

is not legal C++. BankingSystem is a type, and you're trying to use it as an object.
Topic archived. No new replies allowed.