M
mike-yue
and, Is it possible to call one main function from another main
function?
Thanks guys.
function?
Thanks guys.
mike-yue said:and, Is it possible to call one main function from another main
function?
Thanks guys.
and, Is it possible to call one main function from another main
function?
jacob navia said:In general you can't have two functions with the same name in C
(or in any other language for that matter)
If you think about it
*HOW* would the program recognize which is which if they have the same name?
Ben said:For someone who wants to extend C in the direction of C++, you
are remarkably ignorant of C++ features.
jacob navia said:Ahh excuse me. I thought we were discussing C here.
In general you can't have two functions with the same name in C
(or in any other language for that matter)
If you think about it
*HOW* would the program recognize which is which if they have the same name?
Walter said:There are a number of languages (such as maple) that make it trivial
to have multiple functions with the same name.
Scope.
mike-yue said:and, Is it possible to call one main function from another main
function?
No, the signature of the functions must be different. THAT can't be
the case with "main"
local main;genmain := proc(Y)
maingenmain(17);
"This is main 17"%(2);
maingenmain(18);
"This is main 18"%(2);
maingenmain(17);genmain(18);
"This is main 17"%%(2);%%(2);
0x - x;
gx := proc() local x; x end procgx := proc() local x;x end proc;
x - xgx() - gx();
int main(void)jacob said:No, the signature of the functions must be different. THAT can't be
the case with "main"
jacob navia said:No, the signature of the functions must be different. THAT can't be
the case with "main"
Robbie Hatley said:"mike-yue" wrote:
No. Not in C. There must be exactly ONE main, with one of these two
signatures:
int main (void)
int main (int, char**)
mike-yue said:and, Is it possible to call one main function from another main
function?
Citation?
'main' is not in the C89 list of reserved identifiers, and the C89
section 2.1.2.2.1 Program Startup has no obvious restriction against
there being a different main that does not have external linkage.
and, Is it possible to call one main function from another main
function?
Thanks guys.
Harald van Dijk said:I suspect that the OP means something different by "main function", but I
do not know what.
jacob said:If you think about it
*HOW* would the program recognize which is which if they have the same
name?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.