[C++] function pointers

Hi,

I have a namespaced function inside a shared library:
 
void foo::Bar() {};


If the code inside the shared library stores this function's address (into a function pointer), will the address be the same if the same thing is done from the app using this library?
Yes. The loader loads code into the processes address space, and it's the same address seen by all code in that process.

A shared library shares code (not data), and the other process will load the code somewhere, usually at a different address. But that doesn't matter, all code in that 2nd process will see the address for that instance of the function (which is possibly a different address).
Topic archived. No new replies allowed.