www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - Virtual Functions, Classes and friend functions

↑ ↓ ← "Pramod Subramanyan" <pramod_sx rediffmail.com> writes:
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 ?
Apr 22 2001
→ Jan Knepper <jan smartsoft.cc> writes:
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
Apr 22 2001
→ Roland <rv ronetech.com> writes:
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 ?

May 02 2001