User Profile

Collapse

Profile Sidebar

Collapse
bhanupratapgupta
bhanupratapgupta
Last Activity: Nov 5 '06, 09:21 PM
Joined: Oct 29 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • bhanupratapgupta
    replied to Problem of virtual function
    in C
    p->a initializes 'a' of base class, but which 'a' .......as data type are bind with an object not class, so from where it find 'a' of object o.

    If p=&o is removed from the program, it is giving segmentation fault ?
    I am very confused with all these behavior of compiler....
    See more | Go to post

    Leave a comment:


  • bhanupratapgupta
    started a topic Problem of virtual function
    in C

    Problem of virtual function

    # include<iostrea m>
    using namespace std;
    class one
    {
    public:
    int a;
    virtual void fun()
    {
    cout<<"\n In Base\t a ="<<a;
    cout<<endl;
    }
    }o;
    class two : public one
    {
    public :
    int a;
    void fun()
    {
    cout<<"\n In Derived\t a ="<<a;
    }
    }o1;
    int...
    See more | Go to post
No activity results to display
Show More
Working...