I have a function in a header that needs to be implemented for the rest of the code to work. Normally I would implement this function in main.c
after including the header and the linker would clean up the rest.
For example let's say this function is void foo(bool);
in foo.h
If I have another function implemented as part of some other code that matches the task exactly let's say void bar(bool);
implemented in some bar.h
and bar.c
I would normally go about linking the two by means of including bar.h
and doing
void foo(bool var) { bar(var);}
If there's a lot of these, it's basically just a lot of one line functions for telling the function to call a different one.
Is there a different way to accomplish this?