Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
Question on recursion
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
Ariharan
New Member
Join Date:
Aug 2007
Posts:
20
#1
Question on recursion
Feb 17 '08, 04:48 AM
Is this a recursion
Code:
main() { fun1(); } fun1() { fun2(); } fun2() { fun1(); }
Last edited by
Ganon11
;
Feb 17 '08, 06:54 AM
.
Reason:
Please use the [CODE] tags provided.
ashitpro
Recognized Expert
Contributor
Join Date:
Aug 2007
Posts:
542
#2
Feb 17 '08, 05:25 AM
Originally posted by
Ariharan
Is this a recursion
main()
{
fun1();
}
fun1()
{
fun2();
}
fun2()
{
fun1();
}
Yes,this is a recursion.
But called as indirect recursion
Comment
Post
Cancel
Ganon11
Recognized Expert
Specialist
Join Date:
Oct 2006
Posts:
3651
#3
Feb 17 '08, 06:55 AM
It will result in an infinite loop. I hope that in your actual code you take measures to avoid this.
Comment
Post
Cancel
Ariharan
New Member
Join Date:
Aug 2007
Posts:
20
#4
Feb 17 '08, 07:24 AM
Originally posted by
Ganon11
It will result in an infinite loop. I hope that in your actual code you take measures to avoid this.
In my actual code there is a condition that terminates infinite loop...
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment