CCPi-Regularisation-Toolkit
CCPi-Regularisation-Toolkit copied to clipboard
C functions should return int or void
int
would be better so that basic checks could be implemented
@paskino not sure what you mean exactly? C functions currently return either zero or a pointer to an array. What do you mean by int
?
It's a good practice to return int
s on C functions so that one can check the return value and decide if it run correctly: i.e. if return is 0 then OK, otherwise some problem.
int function(int a, float* b){
...
if (something goes wrong)
return 1;
...
if (something else goes wrong)
return 2;
return 0;
}
If you want to return an array it'd be better to have it passed in the arguments.
ok it makes sense. Will try to incorporate.