Post Reply 
Why "return 0;"
02-05-2018, 10:29 PM
Post: #10
RE: Why "return 0;"
Put simply, when something works, it just works - you need one indication of success and whatever results you expect.
When something doesnt work, you need many different indications to show where the error is and what to do about it. A parameter error? A disk error? Memory full?

So, the single value for success is 0 and the many other values indicate errors...
It has been common practise since early DOS, if not sooner.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Why "return 0;" - compsystems - 02-05-2018, 02:27 AM
RE: Why "return 0;" - Paul Berger (Canada) - 02-05-2018, 04:15 AM
RE: Why "return 0;" - compsystems - 02-05-2018, 12:25 PM
RE: Why "return 0;" - toml_12953 - 02-05-2018, 04:29 PM
RE: Why "return 0;" - Carlos295pz - 02-05-2018, 02:32 PM
RE: Why "return 0;" - compsystems - 02-05-2018, 03:22 PM
RE: Why "return 0;" - Tim Wessman - 02-05-2018, 05:01 PM
RE: Why "return 0;" - DrD - 02-05-2018, 05:18 PM
RE: Why "return 0;" - TheKaneB - 02-05-2018, 07:35 PM
RE: Why "return 0;" - StephenG1CMZ - 02-05-2018 10:29 PM
RE: Why "return 0;" - salvomic - 02-05-2018, 10:43 PM



User(s) browsing this thread: 1 Guest(s)