Re: push_back problem.

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Bo Persson (bop_at_gmb.dk)
Date: 01/09/05


Date: Sun, 9 Jan 2005 17:41:44 +0100


"Justin Marshall" <JustinMarshall@discussions.microsoft.com> skrev i
meddelandet news:9B6F6552-981A-4773-AD7A-60C0136AC9AA@microsoft.com...
> Ive debugged it, and it doesn't become NULLS(thats how it appears in
> debug
> anyway), untill it reaches the push_back function.
>
> Aside from this being a really horrific function, it works in the main
> half
> of my program. ReadToken takes a extra parmetor which gets compared
> against
> the next token. The actuall function that reads it is ReadWord which
> is
> listed below.
>
> char *jmParser::ReadWord(void)
> {
> char token[60];
> char *c = new char[60];
> int i = 0;
>

snip

>
> return token;
> }

And right here you return a pointer to the local token buffer. It
disappears as soon as the function ends!

Bo Persson



Relevant Pages

  • Re: push_back problem.
    ... Ive debugged it, and it doesn't become NULLS(thats how it appears in debug ... untill it reaches the push_back function. ... Aside from this being a really horrific function, it works in the main half ... through the crap we dont need ...
    (microsoft.public.vc.stl)
  • asp.net debug issue
    ... I am running visualstudio.net 2002 and I am trying to debug an asp.net ... The page loads fine and it works up untill the error which is ... When I try to run the debugger I get the ...
    (microsoft.public.vsnet.debugging)