problem with c++ in du4.0d

From: james_at_agadirnet.net.ma <james_at_digitem.net.ma>
Date: Mon, 05 Jul 1999 09:42:25 +0000

Hi managers,

How can i declare classes under 4.0d when they are in external file?

for example:

File base.cxx :

class base {
    int i;
   public:
    void seti(int n);
    void showi();
};
void base::seti(int n)
{
     i=n;
}
void base::showi()
{
     cout << "content of base i is: " << i << "\n";
}



File derived.cxx
class derived : public base {
   public:
    void set(int n);
    void show();
};
void derived::set(int n)
{
     // base call::seti(n);
}
void derived::show()
{
     // base call::showi();
}


File main.cxx
class derived1 : public base {
   public:
    void set(int n);
    void show();
};
void derived1::set(int n)
{
     seti(n+1);
}
void derived1::show()
{
     showi() / 2;
}
main()
{
     derived ob;
     derived1 ob1;
     ob.set(5);
     ob.show();
     ob1.set(6);
     ob1.show();
     ob.show();
}


What can i add in the declaration of files derived.cxx and main.cxx to
work?

Regards,
James
Received on Mon Jul 05 1999 - 09:41:13 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:39 NZDT