www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/17/01:52:27

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 00:45:55 -0500
Message-ID: <01bdb146$46cfea20$1c1f1bc4@default>
MIME-Version: 1.0

Hello,

I have a class that has an object of another class like attribute, something
like this:

class miClase
{
public:
miClase ();

private:
Objeto k;
}

the Objeto class:

class Objeto
{
public:
Objeto ( String );
}

the problem is that when I am at miClase constructor I want to initalize the
k object, but the compiler already called de () ( empty ) constructor, that
the class Objeto hasn't.

if I try in the miClase constructor something like "k = Objeto ( String
("string") )" I get many errors from Ios and others, if I try "k ( String
("string") )" it says that I cannot ( cast ) (Objeto)(miClase&).

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