C++ Recursion Quiz : Some Light Relief...

Started by
10 comments, last by Ozz 23 years, 2 months ago
Yeah, it generates numbers from the Fibonacci series.

( I really shoulda got that one first! hehehe.. ahh well. nevermind )

~Cobra~
"Build a man a fire, and he will be warm for a day. Set a man on fire, and he will have warmth for the rest of his life"
Advertisement
quote:Original post by abrunyee

Just being picky, here. I''ve not tried compiling it, but wouldn''t it fail as not all control paths actually return a value?

E.g. If you called dosomething(-2)...


You''d get stuck in an infinite loop, for sure, but it would still compile. dosomething(-2) _does_ have a return value, it''s doSomething(-3) + doSomething(-4).

anyway my point is that it would _not_ fail to compile.

/riley
--Riley

This topic is closed to new replies.

Advertisement