Thread overview
Virtual Functions, Classes and friend functions
Apr 22, 2001
Pramod Subramanyan
Apr 22, 2001
Jan Knepper
May 02, 2001
Roland
April 22, 2001
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
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
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 ?