For starters, I'd recommend putting the following into a header, say "tables.h".
struct employee
{
char name[20];
int schedule;
int level;
};
extern struct employee salesdept[10];
Then in"tables.cpp" have this.
#include "tables.h"
int show_employee_data(void)
{
struct employee *ptr_sales;
ptr_sales=&salesdept[0];
for(int i=0; i<10; i++)
{
printf("Employee: %s\n",ptr_sales->name);
printf("Shift: %d\n",ptr->schedule);
printf("Level: %d\n\n\n",ptr->level);
}
// ...
}
And then change"main.cpp" to this.
#include "tables.h"
struct employee salesdept[10];
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314