+ 4
What is the difference between int main() & Void main() ?
7 Respostas
+ 8
void return type for main should never be used. As simple as that.
http://www.stroustrup.com/bs_faq2.html#void-main
+ 7
Actually in c++ only int main is used, remember we write return 0; to tell that code is ended properly, so main() function returns integer so int main is used. void main() is invalid in c++.
But in c void main can also be used but it is not considered as a good practice, but it is okay to use void if your main() may not return any value.
+ 6
@Hatsy Rei, by now you must have helped, 5 thousand 6 hundred plus people with ur posts, it's time now to make a support bot for SoloLearn posts 😁😁,
btw how to proceed if we wanna mk something like that , assuming we have a supportive API from SL
+ 2
If you wright int main , your program return value to operation system. void main - does not return value.
+ 2
write void main
and write return 0
error occur
now think yourself
+ 1
means void is not necessary