Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    Not to mention the fact that listHead->next is set to point to a local variable and will become dangling once the function exits. Commented May 11, 2013 at 9:51
  • @Angew: Correct, I stopped at the first problem ;) Thank you for mentioning it, I am going to add it to the answer Commented May 11, 2013 at 9:52
  • @First problem I was inattentive enough to omit the return statement in my code snippet. Of course you're right and thank you for commenting on that. @Second problem: I've changed the line in which I create the array, and now it works fine. Thank you both for helping me on that ;) In case somebody experienced similar problem: node** headNext = new node*[MAX_LEVEL]; Now the array will not be lost after the function exits. Commented May 11, 2013 at 11:10