+ 1

what if we put return 1 in main function eg int main () { • • • • • • • • return 1; }

21st Jun 2016, 8:53 AM
Tushar Chetan
Tushar Chetan - avatar
6 Answers
+ 2
dude...don't ask soo small things...try it out yourself...
25th Jun 2016, 2:47 PM
Mukul Kumar
Mukul Kumar - avatar
0
That returns 1 to the operating system indicating that the program had an error (as every non 0 value).
21st Jun 2016, 9:08 AM
Stefan
Stefan - avatar
0
you can put anything for an error
21st Jun 2016, 10:25 AM
Klodian Lula
Klodian Lula - avatar
0
Can you? As far as I know the convention to signal an error via return code is to return a non-zero value. The basic Linux tools actually have different return code which signal different errors.
21st Jun 2016, 10:28 AM
Stefan
Stefan - avatar
0
it returns value of main
21st Jun 2016, 1:40 PM
Saurabh Gandhi
0
it will return error of runtime (if any)!!!
24th Jun 2016, 3:16 AM
p@w@n
p@w@n - avatar