bu yüzden aşağıdaki görevi çözmeye çalışıyorum:
Aşağıda bulduğum kod var. Verileri doğru depolamakta sorun yaşıyorum ve read() ve output() işlevini nereye koyacağımdan emin değilim. Bu muhtemelen çok zor değil ama hala emin değilim. Biri bana ipucu verebilir mi? Teşekkürler!
#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;
}