0

Why not we use void as a main function rather than using int

As void function don't return any value and if we take int we have to return sime value so why not we prefer void as a function https://code.sololearn.com/cPsLUtdaVmSY/?ref=app

26th Jun 2019, 11:43 AM
Manthan
Manthan - avatar
2 Answers
0
Hi. Try reading this https://www.gnu.org/software/libc/manual/html_node/Exit-Status.html In fact you are telling the calling program that your part went fine or you experienced an error in your execution depending on the value you return in the int main()
26th Jun 2019, 2:14 PM
ChrA
ChrA - avatar