Click here to Skip to main content
15,901,505 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: can main() be overloaded?? Pin
Emilio Garavaglia18-Aug-10 22:40
Emilio Garavaglia18-Aug-10 22:40 
GeneralRe: can main() be overloaded?? Pin
CPallini18-Aug-10 22:51
mveCPallini18-Aug-10 22:51 
GeneralRe: can main() be overloaded?? Pin
Aescleal18-Aug-10 23:12
Aescleal18-Aug-10 23:12 
GeneralRe: can main() be overloaded?? Pin
CPallini18-Aug-10 23:40
mveCPallini18-Aug-10 23:40 
GeneralRe: can main() be overloaded?? Pin
DrFrankenstein9019-Aug-10 7:30
DrFrankenstein9019-Aug-10 7:30 
GeneralRe: can main() be overloaded?? Pin
David Crow19-Aug-10 7:50
David Crow19-Aug-10 7:50 
GeneralRe: can main() be overloaded?? Pin
MarvinMartian19-Aug-10 6:37
MarvinMartian19-Aug-10 6:37 
GeneralRe: can main() be overloaded?? Pin
Emilio Garavaglia19-Aug-10 9:33
Emilio Garavaglia19-Aug-10 9:33 
False.
The standard explicitly says that if you omit the return statement, main must return 0. Older compiler didn't do that, bat that was their fault.

void main() is not C++. It is a Ms extension, that have been adopted also by very few other compiler designed for windows environment.

whither you define main (int or void) the system cannot know (it is not statically linked to your program) and always expect an int to be returned.
if you return void your main function, simply doesn't write any value in the bottom of the stack, that is left as the OS created it (i.e. with garbage inside).

2 bugs found.
> recompile ...
65534 bugs found.
D'Oh! | :doh:


GeneralRe: can main() be overloaded?? Pin
MarvinMartian19-Aug-10 10:50
MarvinMartian19-Aug-10 10:50 
GeneralRe: can main() be overloaded?? Pin
Aescleal20-Aug-10 8:16
Aescleal20-Aug-10 8:16 
GeneralRe: can main() be overloaded?? Pin
MarvinMartian20-Aug-10 8:50
MarvinMartian20-Aug-10 8:50 
AnswerRe: can main() be overloaded?? Pin
AmbiguousName18-Aug-10 21:43
AmbiguousName18-Aug-10 21:43 
GeneralRe: can main() be overloaded?? Pin
Emilio Garavaglia18-Aug-10 22:48
Emilio Garavaglia18-Aug-10 22:48 
GeneralRe: can main() be overloaded?? Pin
Paul Michalik18-Aug-10 22:56
Paul Michalik18-Aug-10 22:56 
GeneralRe: can main() be overloaded?? Pin
Emilio Garavaglia19-Aug-10 9:38
Emilio Garavaglia19-Aug-10 9:38 
GeneralRe: can main() be overloaded?? Pin
Paul Michalik19-Aug-10 22:10
Paul Michalik19-Aug-10 22:10 
GeneralRe: can main() be overloaded?? Pin
Emilio Garavaglia19-Aug-10 22:38
Emilio Garavaglia19-Aug-10 22:38 
AnswerRe: can main() be overloaded?? Pin
englebart19-Aug-10 3:14
professionalenglebart19-Aug-10 3:14 
JokeRe: can main() be overloaded?? Pin
tsafdrabytrals19-Aug-10 4:44
tsafdrabytrals19-Aug-10 4:44 
GeneralRe: can main() be overloaded?? Pin
Paul Michalik19-Aug-10 22:14
Paul Michalik19-Aug-10 22:14 
QuestionHow to fetch "User must change password at next logon" through LDAP authentication in ADSI? Pin
Kushagra Tiwari17-Aug-10 23:57
Kushagra Tiwari17-Aug-10 23:57 
AnswerRe: How to fetch "User must change password at next logon" through LDAP authentication in ADSI? Pin
Garth J Lancaster18-Aug-10 0:34
professionalGarth J Lancaster18-Aug-10 0:34 
GeneralRe: How to fetch "User must change password at next logon" through LDAP authentication in ADSI? Pin
Kushagra Tiwari18-Aug-10 1:54
Kushagra Tiwari18-Aug-10 1:54 
GeneralRe: How to fetch "User must change password at next logon" through LDAP authentication in ADSI? Pin
Garth J Lancaster18-Aug-10 2:21
professionalGarth J Lancaster18-Aug-10 2:21 
AnswerRe: How to fetch "User must change password at next logon" through LDAP authentication in ADSI? Pin
Kushagra Tiwari23-Aug-10 0:27
Kushagra Tiwari23-Aug-10 0:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.