소스와다른질문.(소스)
해까닥
이해가안가네요
명시적이랑묵시적예를들어서설명해주세요,
------------------------------------------------------------------------------------
마지막질문은요....정말정말이해가안가는건데요 예제입니다.
/*
EmployeeManager1.cpp
*/
#include iostream
using std::endl;
using std::cout;
class Permanent
{
private:
char name[20];
int salary;
public:
Permanent(char* _name, int sal);
const char* GetName();
int GetPay();
};
Permanent::Permanent(char* _name, int sal) {
strcpy(name, _name);
salary=sal;
}
const char* Permanent::GetName()
{
return name;
}
int Permanent::GetPay()
{
return salary;
}
class Department
{
private:
Permanent* empList[10];
int index;
public:
Department(): index(0) { };
void AddEmployee(Permanent* emp);
void ShowList(); // 급여 리스트 출력.
};
void Department::AddEmployee(Permanent* emp)
{
empList[index++]=emp;
}
void Department::ShowList() // 급여 리스트 출력.
{
for(int i=0; iindex; i++)
{
coutname: empList[i]-GetName()endl;
coutsalary: empList[i]-GetPay()endl;
coutendl;
}
}
int main()
{
//직원을 관리하는 CONTROL 클래스
Department department;
//직원 등록.
department.AddEmployee(new Permanent(KIM, 1000));
department.AddEmployee(new Permanent(LEE, 1500));
department.AddEmployee(new Permanent(JUN, 2000));
//최종적으로 이번달에 지불해야할 급여는?
department.ShowList();
return 0;
}
여기서요... 전체올렷는데요...해석은이해할수잇는데밑에부분말이죠..paysk.. loyee등이런거도저히이해가....
물론소스는 안해줘도되는데..저거맨위에거해주세요..명시적과묵시적예를들어서까지요....ㅠㅜㅠ