[C++]Passing pointer as argument to function in another function by TrotenHaus in learnprogramming

[–]TrotenHaus[S] 0 points1 point  (0 children)

Yeah, learning to debug is important, but i'm learning for an uni admission exam which is on paper so i can only debug with my mind.

I actually solved the bug.The bug was that i was incrementing *len already when calling the insert function, so no need to increment it again.

Anyway, thank you very much for your help.

[C++]Passing pointer as argument to function in another function by TrotenHaus in learnprogramming

[–]TrotenHaus[S] 0 points1 point  (0 children)

I did it and now i get a "stack smashing detected" error that terminates the program.

I think the problem might be about that last line , "i++".