Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct database{
- char fullname[50]; //Full names
- int addr; // The address
- float salary; // Salaries
- int id; // Employees' ID numbers
- int noEmpl; // Number of emlployees
- } database;
- typedef struct database *db;
- db construct_db(void);
- int main(void)
- {
- database *employee[80];
- for(int index=0;index<80;index++)
- {
- employee[index]=construct_db();
- }
- /* your code here */
- return 0;
- }
- db construct_db(void)
- {
- db ret=calloc(1,sizeof(database));
- if(ret==NULL)
- {
- fprintf(stderr,"Error: Calloc returns NULL in construct_db.\n");
- exit(EXIT_FAILURE);
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement