这是我的项目的文件。我不明白为什么我在括号上出现三个错误。作为记录,在在这里发布问题之前,我已经多次尝试解决这个问题。我已经研究了很长时间,以至于我只是忽略了问题所在。既然另一双眼睛已经为出了什么问题闪过红灯,我现在觉得问起来很愚蠢。我只是拒绝在完成它之前停止工作。但是,再次感谢大家的投入和帮助。错误:
错误:
----\bankingsystem.h(45) : error C2236: unexpected 'class' 'BankingSystem'. Did you forget a ';'?`
----\bankingsystem.h(45) : error C2143: syntax error : missing ';' before '{'`
----\bankingsystem.h(45) : error C2447: '{' : missing function header (old-style formal list?)`
---\bankingsystem.h(72) : fatal error C1020: unexpected #endif`
#ifndef BANKING_SYSTEM_H
#define BANKING_SYSTEM_H
#include <vector>
#include <iostream>
#include <string> // Used to allow string functions
using namespace std;
class Account {
public:
Account( int accountNumberValue, int passCode, string lastName, string firstName, double balance);
~Account();
void setFirstName ( string & );
string getFirstName();
void setLastName( string & );
string getLastName();
void setAccountNumber( int accountNumberValue );
int getAccountNumber();
void setPassCode( int passCodeValue );
int getPassCode();
void setBalance( double balanceValue );
double getBalance();
private:
string firstName;
string lastName;
int accountNumber;
int passCode;
double balance;
} // end class Account
#endif // Account_h
class BankingSystem
{ ---(45)
public:
BankingSystem();
~BankingSystem();
void addAccount();//option 1
Account query(int accountId);
void deleteAccount();//option 2
Account query(int accountId);
void AccountInquiry();//option 3
Account query(int accountId);
void saveAccount();//option 4
Account query(int accountId);
void loadAccounts();//option 5
Account query(int accountId);
private:
vector<Account> accounts_;
};
#endif ----(72)
我标记了错误发生的位置,第 (45) 和 (72) 行。
我绝不是要求任何人调试我的程序,我只是要求解释为什么会发生这些错误。
为什么会有意想不到的课程?
怎么会有语法错误?