[Dev-C++] newbie function_struct_array problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Dane E. <DE...@pa...> - 2004-05-14 21:31:42
|
Hi,
Dane here. Im having trouble getting my assignment program to compile.
There is something incorrect between the=20
function prototype, function call, and function headerline. But I cant
figure it out. Please can someone help me to understand
where I am going wrong?
=20
Thank you in advance for any help you can offer me. Im sorry if Im not
supposed to include my code. SHould I attach it next time?
=20
Here is my source:
______________________________________________
#include <iostream>
#include <stdlib.h>
#include <string.h>
using namespace std;
void CreateEmployee (struct [], int); //prototype
struct Emp
{
char fname[20];
char lname[20];
int age, id;
};
=20
int qty;
=20
int main()
{
cout << "How many Employees do you want?" << endl;
cin >> qty;
cout << "You chose to create " << qty << "employees" << endl;
=20
Emp Employee[qty];
CreateEmployee(Employee, qty);
//DisplayTeam(qty);
=20
cout << "Nice Job Chap! Peaceout";
=20
system("PAUSE");=20
=20
return 0;
}
=20
void CreateEmployee(struct Employee[], int qty)
{
int b, qtyLocal;
qtyLocal =3D qty;
for (b =3D 0; b < qtyLocal; b++)
{
Employee.id =3D 0;
cout << "Employee Form" << endl;
cout << "First name: " << endl;
cin >> Employee[b].fname;
cout << "Last name: " << endl; =20
cin >> Employee[b].lname;
cout << "Age: " << endl; =20
cin >> Employee[b].age;
cout << "Your Employee Summary is: " << endl;=20
cout << Employee[b].id << endl << Employee[b].fname << endl <<
Employee[b].lname << endl << Employee[b].age; =20
=20
}
=20
}
_______________________________________________
=20
|