0
我已經搜索一噸的線程,並且不能找到解決該錯誤。它發生在線路8錯誤預期構造,析構函數,或類型之前轉換「(」令牌
的BranchStaff.cpp文件是如如下。它作爲另一個類父類。
#include "BranchStaff.h"
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
BranchStaff::BranchStaff(userIDIn, passwordIn)
:userID(userIDIn), password(passwordIn)
{
menuChoice = 0;
over = false;
while (!over) {
cout << "=======================================================" << endl;
cout << "| Teller Terminal System - Branch Staff |" << endl;
cout << "=======================================================" << endl;
cout << "1) Client and Account Management" << endl;
cout << "2) Change password" << endl;
cout << "3) Exit"
cout << "\tPlease choose an option: ";
cin >> menuChoice;
while (menuChoice != 3 && menuChoice != 2 && menuChoice != 1) {
cout << "\tPlease enter a valid option: " << endl;
cin >> menuChoice;
}
switch (menuChoice) {
case 1:
clientManagement()
break;
case 2:
passwordChange()
break;
case 3:
exit();
}
}
}
void BranchStaff::changePassword() {
}
void BranchStaff::clientManagement() {
}
.h文件是如下
#ifndef BRANCHSTAFF_H
#define BRANCHSTAFF_H
#include <string>
#include <iostream>
using namespace std;
class BranchStaff
{
public:
BranchStaff();
BranchStaff(string userIDIn, string passwordIn);
protected:
void clientManagement();
void changePassword();
private:
string userID;
string password;
int menuChoice;
bool over;
};
#endif // BRANCHSTAFF_H
這很容易解決了這個問題。不能相信這是如此基本的東西。感謝您的幫助。 –