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