Thread: 500!
View Single Post
Old Jun 24th, 2005, 10:11 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Caveat: the recursive approach may use up your allotted stack before it uses up the memory you've alloted for the result. Most likely not for a factorial operation, though; the result grows rapidly, to indulge in an understatement.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote