employee.cpp
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:
C#编程
开发平台:
Visual C++
- //employee.cpp
- #include "employee.h"
- #include <iostream.h>
- Employee::Employee(char* n,char* a, char* c, char* s, char* z)
- {
- strncpy(name,n,20);
- name[19]=' ';
- strncpy(addr,a,40);
- addr[39]=' ';
- strncpy(city,c,20);
- city[19]=' ';
- strncpy(state,s,20);
- state[19]=' ';
- strncpy(zip,z,10);
- zip[9]=' ';
- }
- void Employee::ChangeName(char* n)
- {
- strncpy(name,n,20);
- name[19]=' ';
- }
- void Employee::Display()
- {
- cout <<name <<endl
- <<addr <<" " <<city <<endl
- <<state <<" "
- <<zip <<endl;
- }
- char name[20];
- char addr[40];
- char city[20];
- char state[20];
- char zip[10];