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: 40
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
__________________
Free your mind and your OS will follow

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

конечно нет. отсутствует тело конструктора.
__________________
http://аvitya.livejournal.com
Хотели, как лучше, а получилось даже хуже...
Лозунг шахматиста: На каждый шах - ответим матом!
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 12:37.
Top

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