created math operation function using callbacks
part 2/3
This commit is contained in:
parent
86cd1e31c0
commit
6a821910f3
@ -17,6 +17,11 @@ double multiply_cb(int a, int b) { return a * b; }
|
|||||||
double subtract_cb(int a, int b) { return a - b; }
|
double subtract_cb(int a, int b) { return a - b; }
|
||||||
double sum_cb(int a, int b) { return a + b; }
|
double sum_cb(int a, int b) { return a + b; }
|
||||||
|
|
||||||
|
double doMathematicalOperation(int a, int b, double (*op)(int, int))
|
||||||
|
{
|
||||||
|
return op(a, b);
|
||||||
|
}
|
||||||
|
|
||||||
int unlink_cb(const char *fpath, UNUSED const struct stat *sb, UNUSED int typeflag, UNUSED struct FTW *ftwbuf)
|
int unlink_cb(const char *fpath, UNUSED const struct stat *sb, UNUSED int typeflag, UNUSED struct FTW *ftwbuf)
|
||||||
{
|
{
|
||||||
int rv = remove(fpath);
|
int rv = remove(fpath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user