I want to know when it is necessary to include a return statemnt in one's code and also what is the difference between recursion and iteration?
IwalkAlone 7 Light Poster
Recommended Answers
Jump to Post>when it is necessary to include a return statemnt in one's code
When you're returning from any function whose return type is not void.>what is the difference between recursion and iteration?
At what level? At the highest level, there's no difference. Go a bit lower and recursion is …
Jump to Post>So can you say that the point I made is the difference between them?
No. I don't see how the two statements describe a difference unless you're adding the restriction that only one loop can be used ever and it can't be placed in a function.
Jump to Post>Why can't it be placed in a function?
It can. For your statement to be true, both of my conditions would have to be true, and neither of them are.
All 10 Replies
Narue 5,707 Bad Cop Team Colleague
IwalkAlone 7 Light Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
Narue 5,707 Bad Cop Team Colleague
IwalkAlone 7 Light Poster
Narue 5,707 Bad Cop Team Colleague
IwalkAlone 7 Light Poster
IwalkAlone 7 Light Poster
Narue 5,707 Bad Cop Team Colleague
IwalkAlone 7 Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.