그래서 나를 해결하기 위해 노력하고 다음과 같은 작업:
아래 코드는 내가 왔어요. 나는 데 문제가 데이터를 저장하는 올바르게 그리고 나는 확실하지 않을 넣어 읽기()및 출력()함수입니다. 이것은 아마도 모든 아닙니다 너무 어렵지만 나는 아직 확실하지 않다. 할 수 있는 누군가가 어쩌면 저에게 힌트? 감사합니다!
#include <iostream>
#include <iomanip>
using namespace std;
class Employee
{
public:
string name, department;
int age;
void output(string &a, int &b, string &c)
{
cout << name << endl;
cout << "Age: " << age << " years" << endl;
cout << "Department: " << department << endl;
}
void read(int &n)
{
cout << "Enter number, last name and first name:";
cin >> name;
cout << "Enter age:";
cin >> age;
cout << "Enter department:";
cin >> department;
}
};
int main() {
int n;
cout << "Enter number of employees: ";
cin >> n;
Employee* o = new Employee;
Employee employee;
delete o;
}