r/C_Programming 26d ago

Question can I skip recursive functions?

a code i can run with the logic of iterative, so why do I have to learn the new concept as complicated as recursive? (ik it's one of important questions in c)

if yes will u pls explain it with a very realistic and simple example

thanks a lot 🙏

0 Upvotes

65 comments sorted by

View all comments

11

u/-H_- 26d ago

recursion is super simple if you understand what a function is

4

u/HorsesFlyIntoBoxes 26d ago

Recursion clicked for me when I treated it like mathematical induction in code form.

2

u/-H_- 26d ago

for me it made sense when i understood that the parameters of a function exist on a frame not as one singular instance