After fixing some pointer problems with my structures, I decided to move the functions performed on them to another .cpp file.
Here's the definition in my main.cpp above the int main() of course
[B]struct[/B] employee
{
[B]char[/B] name[20];
[B]int[/B] schedule;
[B]int[/B] level;
};
[B]struct[/B] employee salesdept[10];
then in my tables.cpp file I try to initialize these structures
[B]extern struct [/B] employee salesdept[10]; [I]// forward declaration of `struct characters'[/I]
[B]int[/B] show_employee_data([B]void[/B])
{
[B]struct[/B] employee *ptr_sales;
ptr_sales=&salesdept[0];
[B]for[/B]([B]int[/B] i=0; i<10; i++)
{
printf("Employee: %s\n",ptr_sales->name); [I]// invalid use of undefined type `struct characters'[/I]
printf("Shift: %d\n",ptr->schedule); [I]// invalid use of undefined type `struct characters'[/I]
printf("Level: %d\n\n\n",ptr->level); [I]// invalid use of undefined type `struct characters'[/I]
}
[I]// more unrelated code follows, mostly text displaying[/I]
}
I don't think this is a linking problem, because if I comment out the three printf() statements show_employee_data() the rest of the show_employee_data() runs and displays on the screen(not shown in my code above).
By the way in main.cpp I'm currently just assigning constants to the structures just to try and make the show function work.