The standard states that main() should return an int, so main() should return an int.
Printable View
The standard states that main() should return an int, so main() should return an int.
well, finally it's clear for me! standard says that - and i'll follow this rule!
main returns int in any case even if you don't put return statement in it.Quote:
Originally Posted by LMZ
when you declare function one way, and actually it is defined another way - you mess with the stack.
(You say that the main is void - notifying the compiler that the function does not put return value to the stack... Actually main puts something to the stack...)
Messing with the stack has unpredictable results.
2 vart:
Know I absolutely understood why I shouldn't use main as void. Thank you so much!