#return 0 and 1
11 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
return code
it just tells the user if something went wrong
usually 0+ are normal exits
and -1 is failure
but it depends on what u wanna do
In simple language if a condition is true then in Boolean algebra it's defined as 1. And every false condition is defined as 0.
I usually use return 1 and 0 for boolean functions
bool positive(int n)
{
if(n>0)
return 1;
else
return 0;
}
!solved