Jason Chimera SE 7039990101
Mike Knuble SSE 7039990102
Karl Alzner JSE 7039990202
Tom Poti SE 7039990203
Alex Ovechkin EGM 7039990001
我试图从文件中读取上述信息并按姓氏排序.我该如何解决这个错误:
错误:预期':'
我在EmployeeInformation类中声明的字符串?
class EmployeeInformation {
public string firstName;
public string lastName;
public string title;
public string phonenumber;
EmployeeInformation(&firstName, &lastName, &title, &phonenumber)
{
this->firstName = firstName;
this->lastName = lastName;
this->initials = title;
this->id = phoneumber;
}
};
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char**argv) {
ifstream file;
file.open("employees.txt");
if (!file.is_open())
cout << …Run Code Online (Sandbox Code Playgroud)