c++ - Why is my vector code asserting? What is an assert anyway? -
Is there really an "emphasis", or more specifically, how do I get rid of an error? When I make the vector of points in a square with the data member int x, and then do this:
for (I = antiviril_data.bjin); I & lt; antiviral_data .end (); I ++) {if ((* I) - gt; x & gt; max) {antiviral_data.rez (I); }} And to run the program, I did not get any errors until x is greater than maxx and I use .erase (), at this point, Error:
debug tabs failed!
Program: ... My document \ O.exe file: ... contains the \ vector line: 116
expression: ("this-> _Has_container ()", 0 )
For information about how your program can cause failure failure, see the Visual C ++ documentation on the claim.
(Press retry to debug app)
[abort] [try again] [Ignore]
Apart from this , If I try to use cout:
cout & lt; & Lt; (* Antiviral_data.begin ()) - & gt; X's & lt; & Lt; Endl; I get this error:
Debug entry failed!
Program: ... My Documents \ O.exe File: ... contains the \ vector line: 98
Expression: Vector Iterator not deferencable
(Press again to debug an application)
[try again] [unknown]
Can anyone tell me why I Use any data in 've vector, and how to fix it?
Also: Antiviral_Data is a vector of points with an element:
antiviral_data.push_back (new AX1 (player.x, player.a, '& gt; ')); claim that after you wipe one I have increments. Try instead: for (I = antiviril_data.bugin (); I! = Antiviral_data.end ();) {if ((* I) -> gt> x & gt ; Max) I = antiviral_data.erase (i); Other ++ i; }
Also check out Invalid Eater on that page.
Comments
Post a Comment