Alright I've got this header file, and I want to double check to make sure I understand this. I'm in the middle of a huge human resource prgoram and I feel if I understand this structure header file completely I'll be able to create a copy of all data entered into a text file. Ok here is the code:
Code:
#ifndef EMPLOYEE_DATA_H
#define EMPLOYEE_DATA_H
//structure declaration
struct personal
{
char firstname[25];
char lastname[25];
char SSN[12]
};
typedef struct personal PERSONAL;
struct employee
{
char salary[9];
};
typedef struct employee EMPLOYEE;
struct EmpData
{
EMPLOYEE emp_data;
PERSONAL pers_data;
};
typedef struct EmpData EMPDATA;
//function declaration
EMPDATA* enter_data(int* num_array);
EMPDATA get_data();
#endif
Now I've got two structures personal and employee for the separate data. I'm creating a human resource program. Next I have another structure named EmpData that I rename to EMPDATA. Now is this correct? Inside struct EmpData I have two more strucutures defined as EMPLOYEE emp_data; and
PERSONAL pers_data; I have not worked on this program in quite some time so I'm making sure I understand that those are two structures within a structure that way it has all its members so I can manipulate it and add data to it. Lastly I have two functions enter_data and get_data so i can ask the user to enter data and then get that data that was entered to store in the structures I have in this header file. Let me know if I have understoof this correctly?
Thanks!