Please I need help on storing below file data to the struct membersand print the
ID: 3613973 • Letter: P
Question
Please I need help on storing below file data to the struct membersand print them out.Group name - the string giving the name of the associatedgroup/activity. This should be declared in the struct as a charpointer. Each name string should be read in to a temporary array,the length of the string should be found, space should then bemalloced to the char pointer in the struct to hold the size of thename, then the name should be copied from the temp array to thestruct char pointer space. 10/09, 10/07 and 10/12 in the file isnext meeting date (10) and 09,07, and 12 is next month
This is the test file
008 120 3 6.0 p F 10/09 S A MAC VB1 Oozeball 15.00
132 43 1 12.0 p M 10/07 P E NH 110 SWE 15.00
490 88 3 12.30 p W 10/12 V 4 UC 212A FLOC 0.0
This is the struct
struct activities
{
int groupnum;
char *groupname;
float meettime;
char mthalfday;
char meetday;
int meetweek;
int nextmtday;
int nextmtmonth;
char buildingloc[4];
char meetroom[5];
char purpose;
char memtype;
int groupsize;
float groupcost;
};
Explanation / Answer
Here's the concept: Since delimiter from the example looks like a "space" parse thewhole string unto individual strings using space as delimiter. Store it in some arrays or variable or directly to struct.