[EMAIL PROTECTED] wrote:
>         A file will consist of
> 
>         <Field name>:<Value>
>         <Field name>:<Value>

I think most people use strtok to deal with formats like this.

  [read line to inbuf]
  field1=strtok(inbuf,":");
  field2=strtok(NULL,":");

Don't forget to check for NULL (invalid input).

Other possibilities is to use one of the scanf variants, but beware of
buffer overruns..

  fscanf(infile,"%[^:]:%s",&name,&value) == 2


---
Henrik Nordstr�m

Reply via email to