Mail Archives: djgpp/1998/07/17/16:10:12
"Jorge Ivan Meza Martinez" <jimeza AT usa DOT net> wrote:
[snipped code]
> *always* in the Clase1 constructor is called the empty constructor for k, is
> it true?
I don't have the C++ standard here, but it looks like the natural
thing.
> when I try to write "Clase1 ()" the constructor "Clase2()" for k is
> automatically called,
Logic because k is Clase2 and part of Clase1.
> but what about if I want to call "Clase2 ( String,
> int, ...... );" instead of "Clase2()";
Yes, what about it? what does it change? I think it doesn't have to
change anything. Again I don't have the standard but it looks the
natural thing because k is just a member of Clase1, nothing more.
> in BC you can make "k = "Clase2
> String, int, ...... )" but now I can't with DJGPP.
Never trust in BC++ it have a lot of non-portable extentions and
normally Borland doesn't put it clear.
> remember that in this case I am using objects created with out new.
Yes and that's the point, I think you need:
class Clase1
{
.....
Clase2 *k;
}
And inside the Clase1 constructor:
k=new Clase2(....anything you want...);
Instead of expecting some automatic behavior.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -