I have a function that is to return an entire struct. How would I declare the function? What do I use instead of the "void"?
Ex.
void get_data(void)
{
struct emp boss;
printf("Enter Employer's Name, Salary: "
scanf("%s %f", &boss.empname, &boss.salary);
get_date();
hired.yy = boss.hired.yy;
hired.mm = boss.hired.mm;
hired.dd = boss.hired.dd;
return boss;
}
Ex.
void get_data(void)
{
struct emp boss;
printf("Enter Employer's Name, Salary: "
scanf("%s %f", &boss.empname, &boss.salary);
get_date();
hired.yy = boss.hired.yy;
hired.mm = boss.hired.mm;
hired.dd = boss.hired.dd;
return boss;
}