Re: strang behaviour std:vector and XString in VC6.0
From: chris (caj_at_cs.york.ac.uk)
Date: 11/12/04
- Next message: Gerry Quinn: "Re: C++ sucks for games"
- Previous message: Stijn Oude Brunink: "strang behaviour std:vector and XString in VC6.0"
- In reply to: Stijn Oude Brunink: "strang behaviour std:vector and XString in VC6.0"
- Next in thread: John Harrison: "Re: strang behaviour std:vector and XString in VC6.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Nov 2004 12:19:13 +0000
Stijn Oude Brunink wrote:
> Hello
>
> I'm using std:vector to hold some pointers
>
> vector<CBase*> x;
>
> In the debug version I've the following problem:
> After I've added a couple of pointers using the push_back function and I
> iterate over x the program crashes in the iteration loop. If I debug the
> program I see that the Iterator has som strange value which I did not put
> in. Finially I end up in the XString header where there seems to be some
> kind of memory allocation problem. If I ask for the last pointer in x using
> x.back() I get a good result. but x[x.size()-1] produces nonsense;
>
> The problem stated does not occur in release mode.
>
> Does anaybody know what is going on.
>
Unfortunatly, we are not able to debug your code without seeing it.
My advise, as in all similiar cases is to try to reduce your code to an
example of not more than 20 lines which uses no non-standard C++
wherever possible (unless the bug appears to be being causes by
non-standard C++). Then try posting that here or in the relevant newsgroup.
Chris
- Next message: Gerry Quinn: "Re: C++ sucks for games"
- Previous message: Stijn Oude Brunink: "strang behaviour std:vector and XString in VC6.0"
- In reply to: Stijn Oude Brunink: "strang behaviour std:vector and XString in VC6.0"
- Next in thread: John Harrison: "Re: strang behaviour std:vector and XString in VC6.0"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|