C++ Expanding a dynamic array and deleting a pointer -


I know that I do not have all the codes here, but this is a very large code that throws an error when I run my client, in fact, this is not my choice

  delete [] old list;  

And I'm not sure why the code block here, thank you in advance for any comments. Ask whether you need more than me, I'm just trying to figure out whether I'm using the wrong signals Thanks!

Zero OrdListClass :: Expand () {int tempLength = 0; Type the item type * Old List = GetListPtr (); Type the item type * newList; SetSize (EXPANSION_FACTOR * GetSize ()); NewList = new item type [GetSize ()]; SetListPtr (newList); For (Int i = 0; I & lt; GetLength (); i ++) {Nullast [i] = Old List [i]; TempLength = tempLength ++; } Setlanda (Temple Lamp); Delete old list [] OldList = NULL; } // end Expand

Editing 1: Error only appears when you run debugging without debugging if I debug it, it never throws a break on me "Delete [] Old list is on line with "; If I ask it where it's broken when I run without debugging. I realized that I can finally decide the length, I am not worried about this. I'm curious that if I try to remove the programmer then the program breaks. Thanks!

EDIT 2: It seems that I was a dummy and was messing up in VS13. When I try to insert my list, if there is a duplicate key, it throws an exception (duplicate inspector exception ()). What are the exceptions that I want to stop?


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -