0

What is "void main"

10th Nov 2016, 2:57 PM
suman sharma
suman sharma - avatar
3 Answers
+ 8
If the function is void, it means it has no return type and it won't return anything. For exampl "int" has to return integer. There is no huge difference between "void main()" and "int main()", but it is recommended to use "int main()" instead, because only some compilers support it, so it's possible you will get an error just because you use void main(). When you use int main(), it needs to return a value (return 0 means "program executed successfuly"). In some compilers return 0 is not necessarry, because they will add it to the end if you didn't do that.
10th Nov 2016, 3:09 PM
Rebeka Asryan
Rebeka Asryan - avatar
+ 1
void means it doesn't return anything, main means it's the first class that is looked at.
10th Nov 2016, 3:12 PM
Matthew
+ 1
void main is standard signature.Void is return type it means function will not return anything main is reserve/key word it means the execution of program will start from this function Source:
12th Nov 2016, 1:18 PM
Yugal
Yugal - avatar