Hello all,
I have something like this:
typedef void COMMAND (void);
typedef struct
{
int ID;
int copies;
int period;
int InUse;
COMMAND *function;
} resource;
resource resourceTable[6] = {
{A, 5, 6, 0, ProcessA},
{B, 2, 10, 0, ProcessB},
{C, 1, 0, 3, NULL},
{D, 1, 2, 0, NULL},
{E, 1, 2, 0, NULL},
{F, 3, 4, 0, NULL},
};
enum
{
A = 0,
B,
C,
D,
E,
F
}sources
Now I have a different definition file called definition.h:
A 5 6
B 2 10
C 1 0
D 1 2
E 1 2
F 3 4
Now in Main(), I want to read in the resourceTable from definition.h and Use sscanf function. Would anyone please help me to do it? Thank you very much!