Thread: dynamic/static binding

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    17

    dynamic/static binding

    hey, can you guys check this over for me and tell me if i got it right?

    Code:
    class Base
    {
    public:
    	virtual void f1()
    	{
    		f2(); // static binding, because f2 is static
    	}
    
    	void f2()
    	{
    		f3(); // dynamic binding because f3 is virtual
    	}
    
    	virtual void f3()
    	{
    	}
    
    	virtual ~Base() {}
    };
    is this correct? i followed the litmus test. but it never mentioned if it was a call to a method, only mentioned if it was a call to an object. its static. and dyanmic if its using a reference or pointer.
    Last edited by faze; 07-09-2005 at 07:27 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bjarne's member function binding sample is wrong?
    By George2 in forum C++ Programming
    Replies: 9
    Last Post: 03-11-2008, 04:05 AM
  2. boost::shared_ptr and dynamic binding
    By Mario F. in forum C++ Programming
    Replies: 2
    Last Post: 07-24-2006, 03:50 PM
  3. inet_aton()... Noob needs help with sockets :|
    By Maz in forum C++ Programming
    Replies: 3
    Last Post: 11-22-2005, 04:33 PM
  4. dynamic binding
    By freethenet in forum Networking/Device Communication
    Replies: 2
    Last Post: 10-26-2004, 03:31 PM
  5. Static Binding & Dynamic Binding :: C++
    By kuphryn in forum C++ Programming
    Replies: 2
    Last Post: 12-31-2001, 08:51 PM