Re: What will happen if main called in side main function?
- From: Jack Klein <jackklein@xxxxxxxxxxx>
- Date: Fri, 31 Mar 2006 13:12:36 -0600
On 31 Mar 2006 09:03:16 -0800, "Ravi" <ravi.wireless@xxxxxxxxx> wrote
in comp.lang.c:
void main()
{
main();
}
int main()
{
main();
}
It seems apparent from a later message you posted in the thread, you
are asking if the above is a valid program. No, it is not, you cannot
have two functions with external linkage and the same name in a
program. And you cannot have two functions with the same name in a
single translation unit, regardless of linkage.
And main() must be defined with a return type of int.
--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~ajo/docs/FAQ-acllc.html
.
- References:
- Prev by Date: Re: HI, a question on #include
- Next by Date: Re: A question on variable defination
- Previous by thread: Re: What will happen if main called in side main function?
- Next by thread: Significance of trigraph in C preprocessor
- Index(es):
Relevant Pages
|