Re: What will happen if main called in side main function?
- From: "Fred Kleinschmidt" <fred.l.kleinmschmidt@xxxxxxxxxx>
- Date: Fri, 31 Mar 2006 18:44:36 GMT
"Ravi" <ravi.wireless@xxxxxxxxx> wrote in message
news:1143826569.981525.100270@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
But i have read that C can have only one main function, so is thisPlease always include the context of your message.
valid?
int main() {
main();
return 0;
}
There is only one instance of main() defined. It just happens to recursively
call itself.
Forever.
This, on the other hand, will eventually stop:
int num = 10;
int main() {
if ( --num > 0 ) {
main();
}
return 0;
}
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
.
- References:
- Prev by Date: Re: size in kbytes?
- Next by Date: Re: More on pointers to pointers.
- Previous by thread: Re: What will happen if main called in side main function?
- Next by thread: Re: What will happen if main called in side main function?
- Index(es):
Relevant Pages
|
|