C++ - can execute function in diffrent way?
<p>In this code:</p>

<pre><code>void Window::oops()  { printf("Window oops\n"); } 
void TextWindow::oops() { 
printf("TextWindow oops %d\n", cursorLocation);
}
TextWindow x; 
Window      a; 
Window     *b; 
TextWindow *c; 
a = x; a.oops();   // executes Window version 
b = &amp;x; b-&gt;oops(); // executes TextWindow or Window version 
c = &amp;x; c-&gt;oops(); // executes TextWindow version
</code></pre>

<p>What does it mean that <code>b = &amp;x; b-&gt;oops();</code> will execute the TextWindow <strong>or</strong> Window version? How is it decided? </p>
