[EMAIL PROTECTED] wrote:
> I'm working on a little project, and I
> got stuck on a problem. So far, I
> already have interface, and the rest
> created, now, all I need, is a way to
> retrieve information from a file.
>
> A file will consist of
>
> <Field name>:<Value>
> <Field name>:<Value>
>
> the ":" in the middle is the separator,
> and <Value> can be either numbers or
> characters.
> I can figure it out, how to store the
> both variables once retrieved ( I plan on
> using struct ), all I need a sample on
> how to read the file, and retrieve both
> <Field> and <Value>
You can read a line from a stream (i.e. a `FILE *') with fgets(), and
you can get a pointer to the first occurrence of a particular
character using strchr().
--
Glynn Clements <[EMAIL PROTECTED]>