Is main(); function included as loop statement? for example i have a program with subprograms then if I finished a subprogram i will use main(); function to go back from the main program. is that considered as loop?
thanks!!
ronnel09
0
Newbie Poster
Recommended Answers
Jump to PostI am not sure that I understand your question completely.
A loop is a programming construct that repeatedly executes some code while a certain condition is true. Examples are the "for" and "while" constructs.
If you are asking whether something like this is possible:
for(;;) { main(); …
Jump to PostI think I understand your question a bit better, now that I have re-read it.
Calling main() from within main() would be an example of recursion, and not looping. Even so, I don't think recursion on main() is a very good idea. From what I know, it is outright illegal …
Jump to PostCalling main() from within main() would be an example of recursion, and not looping.its not loop. Its just "calling the main function" we don't consider it a loop.
Actually, it's called a recursive loop, so yes, recursion is a loop.
A loop is a programming …
All 10 Replies
_avishek
29
For as long as space endures
_avishek
29
For as long as space endures
Vish0203
-6
Junior Poster
np complete
8
Newbie Poster
Vish0203
-6
Junior Poster
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Vish0203
-6
Junior Poster
_avishek
29
For as long as space endures
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
_avishek
29
For as long as space endures
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.