L
Lyle Fetterly
Hello,
In the case of returning an integer from a function to notify success or
error which does 0 customarily signify? For example:
int chk( int c ) {
...
}
int fn( int c ) {
if( chk( c ) == 0 ) {
printf( "Success\n" );
} else {
printf( "Error\n" );
}
return c;
}
Looking at chk( c ) == 0 and the flow of the if statement, to be in line
with common practice, is the statement correct as is? Or should it become
chk( c ) != 0?
Thanks - Lyle.
In the case of returning an integer from a function to notify success or
error which does 0 customarily signify? For example:
int chk( int c ) {
...
}
int fn( int c ) {
if( chk( c ) == 0 ) {
printf( "Success\n" );
} else {
printf( "Error\n" );
}
return c;
}
Looking at chk( c ) == 0 and the flow of the if statement, to be in line
with common practice, is the statement correct as is? Or should it become
chk( c ) != 0?
Thanks - Lyle.