I have a struct that takes in values for name, id, salary, etc, called Emp. I have a function that creates an array, employee[5], and then uses a for loop to fill in all values. To return these values back to my main function, i use:
my main function looks like this:
1 2 3 4 5 6 7 8
|
int main()
{
Emp Employee;
Employee[] = get_data(); // function to input values, mentioned above.
print_data(Employee);
return 0;
}
|
I am struggling to then pass this struct/array, to a new function, print_data.
currently:
prototype: void print_data(struct Emp[]);
main call: print_data(Employee);
function: void print_data(struct Emp Employee)
I don't believe this is quite correct, and any advice would be appreciated.
Thanks
Crimson