www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/17/14:37:45

Reply-To: "Jorge Ivan Meza Martinez" <jimeza AT usa DOT net>
From: "Jorge Ivan Meza Martinez" <jimeza AT usa DOT net>
To: <djgpp AT delorie DOT com>
Subject: the call of the constructor!
Date: Fri, 17 Jul 1998 13:30:04 -0500
Message-ID: <01bdb1b1$0651e500$071f1bc4@default>
MIME-Version: 1.0

Hello,

thanks Terry ( iceman AT ipass DOT net ) for your answer.

but please world confirm my doubt, I have an object like attribute of
another class,

class Clase1
{
public:
Clase1 ();
...
private:
Clase2 k;
}

and the Clase2 is:

class Clase2
{
public:
Clase2 ();
Clase2 ( String, int, ...... );
}

*always* in the Clase1 constructor is called the empty constructor for k, is
it true ?
when I try to write "Clase1 ()" the constructor "Clase2()" for k is
automatically called, but what about if I want to call "Clase2 ( String,
int, ...... );" instead of "Clase2()"; in BC you can make "k = "Clase2
 String, int, ...... )" but now I can't with DJGPP.

remember that in this case I am using objects created with out new.

thanks for your help.

jorge ivan meza martinez
http://members.xoom.com/THP
jimeza AT usa DOT net

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019