tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: "james () agadirnet ! net ! ma" <james () digitem ! net ! ma>
To: tru64-unix-managers
Subject: problem with c++ in du4.0d
Date: Mon, 05 Jul 1999 09:42:25 +0000	[thread overview]
Message-ID: <96079058315696.tru64-unix-managers.marc@archive.invalid> (raw)

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

                 reply	other threads:[~1999-07-05  9:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox