I have a structure, say
typedef struct
{
char a[10];
char b[10];
int i;
} test;
Based on the user input of how many instances to create , i should create instances prefixed with runtime data.
For ex., if user says 3 which has to be prefixed with "US", i need to create
test *UStesting1;
test *UStesting2;
test *UStesting3;
and i need to load various file into each instance.
For e.g, USTesting1 will contain data from File US1.in;
USTesting2 will contain data from File US2.in;
& USTesting2 will contain data from File US3.in;
Again, i'm using malloc and free to decide the size of the array structure based on the number of entries in input file.
How can i do this?
Can anyone help me on this, since this is a bit urgent!!
Thanks in advance,
Priya
typedef struct
{
char a[10];
char b[10];
int i;
} test;
Based on the user input of how many instances to create , i should create instances prefixed with runtime data.
For ex., if user says 3 which has to be prefixed with "US", i need to create
test *UStesting1;
test *UStesting2;
test *UStesting3;
and i need to load various file into each instance.
For e.g, USTesting1 will contain data from File US1.in;
USTesting2 will contain data from File US2.in;
& USTesting2 will contain data from File US3.in;
Again, i'm using malloc and free to decide the size of the array structure based on the number of entries in input file.
How can i do this?
Can anyone help me on this, since this is a bit urgent!!
Thanks in advance,
Priya
Comment