+ 1

Is it fine to write : " int main()" or " void main ()" in c++ ?

void & int main () in c++

7th May 2018, 12:05 PM
Hassan Abdullah Alzubidy
Hassan Abdullah Alzubidy - avatar
2 Respostas
+ 8
Never use void main(). It has never been, and will never be, part of the C/C++ standard. http://www.stroustrup.com/bs_faq2.html#void-main
7th May 2018, 1:37 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
it is a return type if you use int then you have to use return 0; statement, in void return is not used
7th May 2018, 12:22 PM
Pragati Mahajan
Pragati Mahajan - avatar