Void or int func | SoloLearn: Learn to code for FREE!


Void or int func

Do we can use void main() ?

12/15/2017 4:30:16 PM


3 Answers

New Answer


void main() is not standard and we usually see it with turbo c++. because it's not standard, it wont work with standard compilers like the one SoloLearn uses. it's best to use int main.


To add to Jamie's fantastic answer, here is the thoughts of the author of the language on void main: http://www.stroustrup.com/bs_faq2.html#void-main