[SDL] Not really SDL related. C++ problem.
Justin Coleman
jmcoleman at gmail.com
Thu Mar 8 14:59:05 PST 2007
You may have a newline after your last line of data. IIRC that can
give you one blank line before the EOF but after your last line of
data. Try this: as soon as you read in a line, check the length of it
and echo that to the screen. That might help narrow it down.
On 3/8/07, Chris Rajula <superrajula at gmail.com> wrote:
> Actually, the code in itself works just fine.
> I've checked this by looking at the output with cout...
> The switch-case-thingy does it's thing, i.e it reads the width,height, depth
> and so on from the file, and stores them in width height etc.
> So, the code-snippet (the switch-case) finishes it's task, but it never
> seems to complete itself per se....
>
> It's very strange all in all...
> P.S
>
> Are there any good C++-related mailing lists out there?
>
> /Chris
>
> On 3/8/07, Ryan C. Gordon <icculus at icculus.org> wrote:
> >
> > > terminate called after throwing an instance of 'std::out_of_range'
> > > what(): basic_string::substr
> > > [...snip...]
> > > istringstream typo(line.substr(0,line.find(" ")));
> >
> > I would guess that line.find() is returning -1 or something on a line
> > without a space (an empty line?). As you don't catch the exception (and
> > probably shouldn't in this case), the default exception handler is
> > terminating the app.
> >
> > That being said: we are helpful people--at least I hope so--but let's
> > try to keep the SDL list limited to SDL questions.
> >
> > --ryan.
> >
> > _______________________________________________
> > SDL mailing list
> > SDL at lists.libsdl.org
> > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
> >
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
More information about the SDL
mailing list