read a file and store thadata in strucure contains char pointer arrays

hello every one..
i have a file in which i have four fields each of them are separated by commas

the file content is like

Base Excess,Arterial Blood Gases,±2mEq/L,±2mEq/L
Bicarbonate (HCO3),Arterial Blood Gases,22-26 mmol/L,22-26 mEq/L
PaCO2,Arterial Blood Gases,35-45 mmHg,35-45 mmHg
PaO2,Arterial Blood Gases,80-100 mmHg,80-100 mmHg
PH,Arterial Blood Gases,7.35-7.45,7.35-7.45
SaO2,Arterial Blood Gases,95-100%,95-100%


and want read the file and store in

struct labvalues
{
char* name[5];
char* category[5];
char* unit1[5];
char* ubit2[5];
}*lab;


the name array should be filled with the first field of each line
the category array should be filled with the second field of each line and respectively ....


please help me its urgent..
fine you can read the whole line as string then you can use substr( ,) which takes 2 arguments
its a string function it can separate the string into parts so you can the get the
first feild and send it to the arrayes.
good luck.
Topic archived. No new replies allowed.