📄 employee.cpp
字号:
// employee.cpp
#include "employee.h"
#include <iostream>
#include <string.h>
Employee::Employee(const char* lst, const char* frst, const char* ttle, int slry)
{
strcpy(last, lst);
strcpy(first, frst);
strcpy(title, ttle);
salary = slry;
}
const char* Employee::getLast() const
{
return last;
}
const char* Employee::getFirst() const
{
return first;
}
const char* Employee::getTitle() const
{
return title;
}
int Employee::getSalary() const
{
return salary;
}
void Employee::setLast(const char* lst)
{
strcpy(last, lst);
}
void Employee::setFirst(const char* frst)
{
strcpy(first, frst);
}
void Employee::setTitle(const char* ttle)
{
strcpy(title, ttle);
}
void Employee::setSalary(int slry)
{
salary = slry;
}
void Employee::print() const
{
std::cout << '{' << last << ',' << first
<< ',' << title << ',' << salary
<< '}';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -