--- In [email protected], Lars Finsen <[EMAIL PROTECTED]> wrote:
> It's very simple. Essentially it goes like this:
>
> ifstream(filename) ui;
if (ui.good)
> while(!ui.eof())
> {
> if(baner==NULL) baner = b = new bane;
> else { b->neste = new bane; b=b->neste; }
> ui >> b->fork >> b->type >>....>> b->ist;
If some of datatypes don't match, the behaviour could be really
strange (for example, if you have a newline character on last line it
might try to load it into b->fork variable and fail). The stream would
set errors instead of eof(), and you would keep trying to read it.
As suggested, you need to check for errors.
--
Milan Babuskov
http://www.guacosoft.com