I've added in the add_employee function to test if the code worked
Code:
int add_employee(Employee **employee,int n_employees)
{
int i;
n_employees++;
*employee=(Employee*) realloc(*employee,n_employees* sizeof(Employee));
if(*employee== NULL)
{
fprintf(stderr, "Error alocating memory!");
exit(1);
}
printf("Introduce employee name:\n");
getchar();
gets( (*employee)[n_employees-1].name);
(*employee)[n_employees-1].id=n_employees
for(i=0;i<n_employees;i++)
{
printf("Name: %s\n",*(*(employee[i].name)));//This isn't working
printf("ID: %d\n",*(*employee)[i].id));
}
return n_employees;
}