1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Some confusion regarding virtual funtion in C++

Discussion in 'C++' started by mayank_3103, Sep 30, 2010.

  1. mayank_3103

    mayank_3103 New Member

    Joined:
    Sep 30, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi All,

    I am having a confusion regarding virtual functions that can be described by example shown below:


    class BaseClass{
    public:
    virtual void Fun();

    };
    class Derived : public BaseClass
    {
    public:

    };

    I want to know that Will there will be any vTable inside the "Derived" class?
    Well I found the size of class "Derived" is 4, so what maked its size of 4 bytes? Please justfy with explaination.


    Thanks in Advance.
    Mayank
     

Share This Page