First of all, you're not programming in C. You're programming in C++. It is a different language. C does not have references or classes. In your code you're not using classes but you are using a reference (for no reason).
Second, consider the meaning of "function pointer". It is the address of the code of that function. Now consider the meaning of "inline". It means the function does not exist independently in machine code. Its source is (conceptually) put in the place where it is called and the calling function is compiled. So you want to take the address of something that doesn't exist.
The short answer is you can't.
What do you want to achieve? Do you want to always call foo from b? If so, you don't need an indirection. You can call an inline function and have it inlined into the call site, or you can call a non-inlined function and produce a real function call.
// a.c
double foo(int a) { return a * 3.1415926; }
// b.c
double foo(int a); // declaration, not definition.
void b(void) { printf("%f\n", foo(10)); }
int main() { b(); return 0; }
Build with:
gcc -O2 -c -o a.o a.c
Notice that when compiling b.c, the compiler does not know what function foo does, it only knows its signature.
gcc -O2 -c -o b.o b.c
This links the two pieces into a single program and adding the parts at the beginning and end that make it possible to run it:
gcc -o program a.o b.o
The difference is efficiency. Inlining allows many optimizations (up to using the values of the arguments to precompute the result and eliminate the code entirely, like here). Inlining where such optimizations are impossible can still be faster because it eliminates the function call overhead and can allow better register allocation, as well as making it more likely the code is in cache. But inlining can be bad because it leads to code bloat and cache pollution, making the code less likely to be in cache.
If you don't know at compile time which function you want to call from b, you need indirection. Thus you would have foo_1 and foo_2 and you would pass to b the pointer to either, and it will call the function pointed to by that pointer, without knowing which one it is. This has a performance penalty, but is sometimes necessary.
double foo_1(int a) { return a * 3.1415926; }
double foo_2(int a) { return a * 2.81; }
void b(double (*foo)(int)) { printf("%f\n", foo(10)); }
int main(int argc, char *argv[])
{
if (argc < 2) return;
b(argv[1][0]-48 ? &foo_1 : &foo_2);
return 0;
}
C++ has a feature in which you can tell the compiler to generate two version of function b from the same source code: one that always calls foo_1 and another that always calls foo_2. Then foo_1 and foo_2 can be inlined at both call sites, and instead of choosing to pass the pointer to foo_1 or foo_2 to b you will need to choose to call b_with_foo_1 or b_with_foo_2.