hi all,
When the processing error is more than two, than which approach is better(as mentioned below):
Say the error may be
ERR_A
ERR_B
ERR_C
ERR_D
1) one approach could be function it self return the error code and it is the responsibility of caller to intialize the error.
2) Another the function return either bool or void and the function itself set the error. As we do in the C for example in the case of file open
please suggest pros and cons..
Laxman Singh
When the processing error is more than two, than which approach is better(as mentioned below):
Say the error may be
ERR_A
ERR_B
ERR_C
ERR_D
1) one approach could be function it self return the error code and it is the responsibility of caller to intialize the error.
2) Another the function return either bool or void and the function itself set the error. As we do in the C for example in the case of file open
please suggest pros and cons..
Laxman Singh
Comment