* problem with c++ in du4.0d
@ 1999-07-05 9:42 james () agadirnet ! net ! ma
0 siblings, 0 replies; only message in thread
From: james () agadirnet ! net ! ma @ 1999-07-05 9:42 UTC (permalink / raw)
To: tru64-unix-managers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-07-05 9:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-07-05 9:42 problem with c++ in du4.0d james () agadirnet ! net ! ma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox