structtest.cpp
上传用户:gtl068a
上传日期:2007-01-25
资源大小:233k
文件大小:1k
- // structtest.cpp
- #include <iostream>
- #include "employeestruct.h"
- using namespace std;
- int main (int argc, char** argv)
- {
- // create and populate an employee
- EmployeeT anEmployee;
- anEmployee.firstInitial = 'M';
- anEmployee.middleInitial = 'R';
- anEmployee.lastInitial = 'G';
- anEmployee.employeeNumber = 42;
- anEmployee.salary = 80000;
- // output the values of an employee
- cout << "Employee: " << anEmployee.firstInitial <<
- anEmployee.middleInitial <<
- anEmployee.lastInitial << endl;
- cout << "Number: " << anEmployee.employeeNumber << endl;
- cout << "Salary: $" << anEmployee.salary << endl;
- return 0;
- }