Are recursive functions limited? Yes.

Started by
19 comments, last by Jiia 21 years, 7 months ago
quote:Original post by Anonymous Poster
Original post by davepermen
just want to that you use new, but you''re not storing the pointer to the new allocated object anywhere. and you delete the object itself (delete this) in the end.. both is for 99% of the time stupid and can result in a crash..



What he did is perfectly fine.

#1 - The pointer is stored… in the object''s ''this'' variable.

#2 - ''delete this;'' is usually a perfectly valid thing to do, so long as you don''t try to use any member vars or functions after calling it.



i said 99%. he''s actually in the 1% where its okay, hehe:D



so, do it different.. do the simulation with particles, and generate new particles if the water splits.. add them in a list, vector, what ever, and go trough the whole array, to process each one. and again and again till the list is empty.. should work..

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

This topic is closed to new replies.

Advertisement