Hi,
I have input such as the following:
This input is fed into a char array using fgets. I then want to be able to split it into a struct.
I would therefore define a struct as:
Code:
Struct input
char firstCode
int secondCode
char fourthCode
char fifthCode
If I had the codes:
Code:
DC12345 54I91L9
AB67891 23LN5TY
they would be split into the following sturcts:
Code:
input[0]
firstCode - DC12345
secondCode-5
fourthCode-4I9
fifthCode-1L9
input[1]
firstCode- AB67891
secondCode-2
fourthCode-3LN
fifthCode -5TY
Could someone please help as to how I would go about feeding this input into the correct elements of the struct?