Re: What will happen if main called in side main function?
- From: "swengineer001@xxxxxxxxx" <swengineer001@xxxxxxxxx>
- Date: 31 Mar 2006 12:43:06 -0800
int main()
{
main();
}
This example will execute forever, provided the machine
running it has infinite resources. Less powerful machines
may be unable to run this program to completion ...
I don't beleive any machine can run this to completion since the
program operates recursively forever. Also this should cause a compiler
warning about no return statement in a non void function, at least on
any compiler I have ever used.
.
- References:
- What will happen if main called in side main function?
- From: Ravi
- Re: What will happen if main called in side main function?
- From: Eric Sosman
- What will happen if main called in side main function?
- Prev by Date: Re: Significance of trigraph in C preprocessor
- Next by Date: Re: Binary or Ascii Text?
- 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):