bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Internal compiler error.


From: Artak Avetyan
Subject: Re: Internal compiler error.
Date: Sat, 24 Feb 2001 16:11:24 +0300

Hi Bala.

Your code was wrong. I've made some changes. Seems, it works.
Pay attention on "^^^^^^^^^" int main() - function, and do appropriate changes
in your One.cpp file.

Regards,
Artak.

//////////////////////////////////////////////////////////////////


#include <iostream.h>
class A
{
protected:
    int a,b;
public:
    A()    {a=10; b=5;}
    virtual void base_display()
    {
        cut << "In Super :";
        cout << a <<endl<< b <<endl ;
       }
};

class B;
typedef void (B::*Display) (int);

class B:public A
{
public :
    Display bala;
    B()
    {
        cout<<"i'm in child \n";
    }
    void display(int r)
    {
        A::base_display() ;
        cout << "I'm in child's display" << a;
    }
};

int main()
{
    B  b;
    b.bala=&(b.display);
    ^^^^^^^^^^^^^^^  chanche to: b.bala = b.display;
    b.bala(5);
   ^^^^^^^^^^^^^^^  change to: (b.*b.bala)(5);
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]