structtest.cpp
Upload User: gtl068a
Upload Date: 2007-01-25
Package Size: 233k
Code Size: 1k
Development Platform:

Visual C++

  1. // structtest.cpp
  2. #include <iostream>
  3. #include "employeestruct.h"
  4. using namespace std;
  5. int main (int argc, char** argv)
  6. {
  7.   // create and populate an employee
  8.   EmployeeT anEmployee;
  9.   anEmployee.firstInitial = 'M';
  10.   anEmployee.middleInitial = 'R';
  11.   anEmployee.lastInitial = 'G';
  12.   anEmployee.employeeNumber = 42;
  13.   anEmployee.salary = 80000;
  14.   // output the values of an employee
  15.   cout << "Employee: " << anEmployee.firstInitial << 
  16.     anEmployee.middleInitial <<
  17.     anEmployee.lastInitial << endl;
  18.   cout << "Number: " << anEmployee.employeeNumber << endl;
  19.   cout << "Salary: $" << anEmployee.salary << endl;
  20.   return 0;
  21. }