0

Why there is 'int' before 'main' function? Int main ()

in tutorial for ex. it works without int

28th Oct 2016, 11:14 AM
quomoow
quomoow - avatar
6 Answers
+ 2
basically int main is used to return some integer most of the time 0
28th Oct 2016, 11:44 AM
imaqtpie
imaqtpie - avatar
0
because it will return, traditionally at least, 0 when it finishes execution which is am integer. now you can do void main but the is just incorrect and not standard. there's even some compilers I believe that reject that so it's best to use int main
28th Oct 2016, 11:26 AM
Daniel Rollins
Daniel Rollins - avatar
- 1
are Include & IosStream is necessary to write in c++ ?
29th Oct 2016, 3:42 PM
Syed Shoaib Hassan
Syed Shoaib Hassan - avatar
- 1
We are classifying main as an integer and any value it gives comes out to be a integer
30th Oct 2016, 5:52 PM
Agastya Asthana
Agastya Asthana - avatar
- 1
Yes, they are necessary because those are the library to code is referring.
30th Oct 2016, 5:52 PM
Agastya Asthana
Agastya Asthana - avatar
- 1
at last we are returning 0 that means okk u are satisfied and anything other than that means opposite,if u dont write that retutn 0 than also it will execute,but when u are using functions with or without return value than return 0 plays an important role in stopping the process...
5th Nov 2016, 5:19 AM
ASHISH RAKESH
ASHISH RAKESH - avatar