-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEmp.cpp
60 lines (46 loc) · 878 Bytes
/
Emp.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Emp.cpp
*
* 작성자: Jungdy
* 작성일자: 2017. 12. 28
* 주제명: 직원 명부 프로그램
*
*/
#include <iostream>
#include <string.h>
#include "Emp.h"
using namespace std;
void Emp::setId(int id){
this->id = id;
}
const int Emp::getId(){
return this->id;
}
const char* Emp::getName() const{
return this->name;
}
void Emp::setName(char* name){
int count = sizeof(name) / sizeof(char);
this->name = new char[count + 1];
strncpy(this->name, name, count);
/*
for ( int i = 0; i < count; i++ ){
this->name[i] = name[i];
if ( ( i + 1 ) == count ){
name[i + 1] = '\0';
}
}
*/
}
const int Emp::getGrade(){
return this->grade;
}
void Emp::setGrade(int grade){
this->grade = grade;
}
const int Emp::getPay(){
return pay;
}
void Emp::setPay(int pay){
this->pay = pay;
}