+ 1

Why should we start code with int main() ? What it does ?

25th Apr 2017, 2:51 PM
Akash Khamkar
Akash Khamkar - avatar
4 ответов
+ 4
int main() is the standard. void main was used in older times. It was removed as part of putting some standards
25th Apr 2017, 3:05 PM
Jishnu Jayarajan
+ 9
As of the latest standard, main() must always return int. Void/bool/char/whatever-dank-not-int-shat is not allowed.
25th Apr 2017, 2:58 PM
Hatsy Rei
Hatsy Rei - avatar
+ 3
It defines the main function for your program, the one that will execute first if your program has multiple functions
25th Apr 2017, 2:55 PM
Welliton Malta
Welliton Malta - avatar
+ 2
Compiler will execute anything in this method I think you can change it to any another type For example : void main () or bool main()
25th Apr 2017, 2:56 PM
‎علي فرعون‎
‎علي فرعون‎ - avatar