title: Is it possible to replace a method at runtime?
body: <p>I want to make a plugin system with the capability to override a method at runtime.</p>
  
  <p>Some answers say function pointers, but how about a defined function or class?</p>
  
  <p>Like this:</p>
  
  <pre><code>class foo
  {
    public:
      bar(int foobar);
  }
  </code></pre>
  
  <p>Is there a way to get function pointer for that, or replace it?</p>
  
  <p>BTW, hooking is not considered an answer because it's very platform specific and dangerous.</p>