c++ member function binding
<p>I read one of the book which deals with the issues of member function binding in c++.</p>

<p>and it's giving the next example:</p>

<pre><code>void Window::oops()  { printf("Window oops\n"); } 
void TextWindow::oops() { 
printf("TextWindow oops %d\n", cursorLocation);

Window      win; 
Window     *winPtr;
TextWindow *txtWinPrt = new TextWindow; 
win    = *txtWinPrt; 
winPtr =  txtWinPtr;
win.oops();     // executes Window version 
winPtr-&gt;oops(); // executes TextWindow or Window version;
</code></pre>

<p>I didn't understand why <code>win.oops</code> would executes window version? win is defined as Textwindow. </p>

<p>Thank you for your help.</p>
