0
why is void main not suggested to be used in a program ?
I would like to know why programmers suggest not to use void main
3 ответов
+ 8
Default thing in C++ is that "main" method is with return type int. You can write "void" but that is mainly used in earlier C
+ 6
Using int main() became the standard because using void main() may break existing code that expect a return.
+ 1
Actually the whole program runs IN the Main function.
if you name another one of your funcions "main" you'll get in trouble as your compiler finds 2 functions named tje same and doesn't know how to handle them resulting in a compiler error.