Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters > C/C++

Reply
 
Thread Tools

Inheritance and Constructor(z)
Old 10.05.2005, 11:37   #1
4294967296
 
Boyov's Avatar
 
Join Date: 03 2002
Location: /proc/1
Age: 39
Posts: 379
Rep Power: 0
Default Inheritance and Constructor(z)

Hi,

PHP Code:
class base
{
int a;
public: 
      
base (int arg) { arg;}

PHP Code:
class derived1virtual public base
{
public:
     
derived1 (int arg): base(arg);
}

class 
derived2virtual public base
{
public:
     
derived2 (int arg): base(arg);

PHP Code:
class derived3: public derived1, public derived2
{
public:
  
derived3(int arg): derived1(arg),derived2(arg);

Is the declaration of derived3 constructor right ?

Thanks in advance

Old 25.05.2005, 19:32   #2
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 42
Posts: 21,717
Rep Power: 9
Default

конечно нет. отсутствует тело конструктора.
Reply




Реклама:
реклама

All times are GMT. The time now is 22:45.
Top

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.