Mail Archives: djgpp/1999/05/23/19:15:21
El día 17 May 1999 15:48:21 GMT, khan AT xraylith DOT wisc DOT edu (Mumit Khan)
escribió:
>>Note that while this is true for C, it is not for C++; in which you
>>can perfectly define main() as returning void, according to the ISO
>>standard.
>
>Wrong. Please check the standard (cf: 3.6.1) before making such
>assertions.
After some discussion in es.lenguajes.c and es.lenguajes.c++ (spanish
newsgroup discussing c and c++ languajes), many people say that
according to the ISO standard, void main() is not incorrect, but
implementation dependent. That is, it is not portable, yet it is
allowed by the standard if the compiler chooses to support it.
It seems that the ISO standard forces a conforming implementation of
the language to support both int main() and int main(int, char **),
but otherwise main can be defined as returning a different type,
altough this is implementation-defined.
Someone said that even Bjarne Stroustrup, in comp.lang.c++.moderated
and comp.std.c++, pointed out that void main() is not incorrect,
altough not recommended.
What do you think?
Regards,
GUILLE
----
Guillermo Rodriguez Garcia
XXguille AT XXiies DOT XXes (ya sabes :-)
- Raw text -