+ 2

Why do we use int main here in solo learn rather than Void as a function?

4th Oct 2018, 11:52 AM
Yashvi Shah
Yashvi Shah - avatar
2 Answers
+ 2
The short answer, is because the C/C++ standard requires main() to return int . As you probably know, the return value from the main() function is used by the runtime library as the exit code for the process. Both Unix and Win32 support the concept of a (small) integer returned from a process after it has finished. First thing that appeared when I searched your question. Taken from stackoverflow.
4th Oct 2018, 12:00 PM
Alexandru Turculet
Alexandru Turculet - avatar
+ 1
Get return value accordingly to programmer
14th Oct 2018, 4:50 PM
Nishant Singh
Nishant Singh - avatar