Is this even compiling for you? Anyways...
I noticed something wrong I overlooked in your code
Code:
struct employee
{
int eid [50];
char estat;
};
'eid' should be a single int not an array.
Also change
Code:
for(i=0; i<n; i++)
a[i]=myemployees[i]; //each element of the array is a structure
to
Code:
for(i=0; i<50; i++)
{
myemployees[i].eid = i;
myemployees[i].salary = // generate a number in the required range here; //each element of the array is a structure
// note that you didnt listen to what i said above, you need to add this third "salary" field to the struct.
// next generate and save a random number with 2 possible values (i.e. from 0 to 1, 1 to 2, whatever)
// have an if statement so that if it is, say, 0, assign this employe's estat to 'f', otherwise assign it 's', or whatever the values are required to be.
Also change
Code:
for(i=0; i<n; i++)
cout << "Enter a customer number between 0 and 49: " << endl;
cin >> eid >> endl;
cout << employee.eid << employee.esal << employee.estat << endl;
to
Code:
cout << "Enter a customer number between 0 and 49: " << endl;
cin >> eid >> endl;
cout << myemployees[eid].eid << myemployees[eid].salary << myemployees.estat << endl;