topical media & game development

talk show tell print

professional-program-01-structtest-structtest.c

? / professional-program-01-structtest-structtest.c


  // 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;
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.