Description: oopscene's blog
Let’s dig a little bit in some implementations (in C++ and Rust) of a function that computes the factorial of an integer passed as argument. I will try to make them as similar as possible and will expose the differences between both:
This is the simplest and most known factorial implementation:
C++ version, using “ while “. I am not using “ for ” because the C/C++/Java/C# -like “ for ” does not exist in Rust.