+ 1
in c++ program on internet Can we write void main() instead of Int main() and what changes we should made on it
4 Answers
+ 2
thnk u all to clear my doubts
+ 1
Now a days, exception handlers play a keyrole in compilation and execution of program tasks. We can write void main() also but usage of...int main() will be appropriate because at the end, if we use return 0; in program...it passes to handler a message that program executed without any error!
Based on error type generated from exception handler, user can easily sortout mistakes.
+ 1
Actually now return 0 is not required... U can write int main() without return 0.
+ 1
Most compilers will support void main() as a feature for lazy programmers. It's not a standard feature in either C or C++, however, and should be avoided. It is not a useful habit by any means.