Thread overview | |||||
---|---|---|---|---|---|
|
April 22, 2001 Virtual Functions, Classes and friend functions | ||||
---|---|---|---|---|
| ||||
How do you tell the compiler that a function is purely virtual and will be declared only in a sub-class ? i.e, There is not implementation for the function in the current class. Can you explicitly declare a virtual class in C++ ? [Like the abstract class keyword in Java] Are friends of base classes not friends of sub-classes ? |
April 22, 2001 Re: Virtual Functions, Classes and friend functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pramod Subramanyan | Pramod Subramanyan wrote: > How do you tell the compiler that a function is purely virtual and will be declared only in a sub-class ? i.e, There is not implementation for the function in the current class. class VirtualBase { public : virtual int PureVirtual () = 0; }; > Can you explicitly declare a virtual class in C++ ? [Like the abstract class keyword in Java] There is all kinds of possibilities in C++. However, I do not know Java well enough to answer these questions. Jan |
May 02, 2001 Re: Virtual Functions, Classes and friend functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pramod Subramanyan | class ACLASS {
public:
virtual int virtual_member()=0;
};
With i don't know witch version of SC or DM C++ sometime i had to create the function on the .CPP:
int ACLASS::virtual_member() {
}
Roland
Pramod Subramanyan a écrit :
> How do you tell the compiler that a function is purely virtual and will be declared only in a sub-class ? i.e, There is not implementation for the function in the current class.
>
> Can you explicitly declare a virtual class in C++ ? [Like the abstract class keyword in Java]
>
> Are friends of base classes not friends of sub-classes ?
|
Copyright © 1999-2021 by the D Language Foundation