First, I should show the question first...
(i) Using typedef, declare a structure called employee which can hold the following details of an employee.
ID
Name
Position
(ii) Using the keyword struct (without typedef), declare a structure called Wrk to store the employee working record consisting of the following details. (You must make use of the structure declared in part (i) above.)
Emp (as in (i) above)
Rate
Hours
Basic
(iii) Define an array, called EmpWrk, of 10 structures of typeWrk declared in part(ii) above. Initialize the first two records as follows:
ID Name Position Rate Hours Basic 771122 Mike Wong Programmer 4.62 40 1800.00 345906 Bill John Manager 8.51 38 2400.00
__________________________________________________ _______
My coding so far....
__________________________________________________ _______Code:#include <stdio.h> #include <stdlib.h> typedef struct { char ID[30]; char Name[30]; char Position; } employee ; struct{ employee Emp; int rate; int hours; int basic; } Wrk; int main(void) { return 0; }
I was stuck at (iii), can someone show me how to define that array like (iii) have mention? Very thanks you.