Wednesday, August 27, 2008


Just messing around with structures, got this example from a book.
#include "stdafx.h"
using namespace std;

int main()
//creating the structure
typedef struct {
char firstInitial;
char middleInitial;
char lastInitial;
int employeeNumber;
int salary;
} EmployeeT;

//Creating and Populating an Employee
//Employee Declaration
EmployeeT anEmployee;
//Building and Defining the Employee
anEmployee.firstInitial = 'M';
anEmployee.middleInitial = 'R';
anEmployee.lastInitial = 'G';
anEmployee.employeeNumber = 42;
anEmployee.salary = 317000;

//Output the values of an employee, in other words, assigns the values

//Prints the values to the screen
cout << "Employee: " <<>

No comments: