Re: What will happen if main called in side main function?
- From: Eric Sosman <Eric.Sosman@xxxxxxx>
- Date: Fri, 31 Mar 2006 12:14:18 -0500
Ravi wrote On 03/31/06 12:03,:
void main()
{
main();
}
This example is incorrect because main() returns an
`int'; it is not a `void' function. The C language does
not define what will happen when you mis-define main()
this way; however, on many implementations the effect
will be similar to the second example.
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 ...
--
Eric.Sosman@xxxxxxx
.
- Follow-Ups:
- Re: What will happen if main called in side main function?
- From: swengineer001@xxxxxxxxx
- Re: What will happen if main called in side main function?
- From: Flash Gordon
- Re: What will happen if main called in side main function?
- From: Ravi
- Re: What will happen if main called in side main function?
- References:
- Prev by Date: Significance of trigraph in C preprocessor
- Next by Date: Re: Significance of trigraph in C preprocessor
- Previous by thread: 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
|