+ 13

What does it mean when the function main() returns a value ??

22nd Apr 2017, 2:14 PM
Saja Husam
Saja Husam - avatar
15 Respuestas
+ 12
Ooh its 5 and a half pm here ! but thnx anyway jay ;)
22nd Apr 2017, 2:33 PM
Saja Husam
Saja Husam - avatar
+ 12
okay , thx ;)
22nd Apr 2017, 3:06 PM
Saja Husam
Saja Husam - avatar
+ 12
Good luck to you too hun ;)
22nd Apr 2017, 3:10 PM
Saja Husam
Saja Husam - avatar
+ 11
@jay can you explain more i didnt get it :(
22nd Apr 2017, 2:24 PM
Saja Husam
Saja Husam - avatar
+ 11
@Antonín , thnx ... i think i got a little bit , after running the code, if the returned value was 1 for ex it gives an output else it gives an error ..
22nd Apr 2017, 2:32 PM
Saja Husam
Saja Husam - avatar
+ 11
@sadaf , while it doesn't do anything why it was used or created then ?!
22nd Apr 2017, 3:01 PM
Saja Husam
Saja Husam - avatar
+ 8
It usually does not return a value, or if it does it is 0 and does not do anything.
22nd Apr 2017, 2:59 PM
Sadaf Soudbakhsh
Sadaf Soudbakhsh - avatar
+ 6
I don't know if it has any special reason or not... but both forms can be used.
22nd Apr 2017, 3:04 PM
Sadaf Soudbakhsh
Sadaf Soudbakhsh - avatar
+ 6
you're welcome and good luck 😉
22nd Apr 2017, 3:09 PM
Sadaf Soudbakhsh
Sadaf Soudbakhsh - avatar
+ 5
it must return a value to the operating system to tell it if it exited correctly
22nd Apr 2017, 2:22 PM
jay
jay - avatar
+ 4
Antonin did a good job.. its 12:30am here. lazy tired atm pls forgive
22nd Apr 2017, 2:30 PM
jay
jay - avatar
+ 2
it returns 0 if code run ok! anything else would be an error code.
8th Jun 2017, 9:11 PM
Farshad Hosseinzadeh
Farshad Hosseinzadeh - avatar
+ 1
to check if u app work correctly.
24th Apr 2017, 10:38 AM
DeleteMe