www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/16/21:16:46

From: "Jean-Francois Desjardins" <jfd50 AT videotron DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: c++
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Message-ID: <HEHq4.4290$CC3.119351@wagner.videotron.net>
Date: Wed, 16 Feb 2000 19:53:45 -0500
NNTP-Posting-Host: 24.200.143.153
X-Complaints-To: abuse AT videotron DOT net
X-Trace: wagner.videotron.net 950748839 24.200.143.153 (Wed, 16 Feb 2000 19:53:59 EST)
NNTP-Posting-Date: Wed, 16 Feb 2000 19:53:59 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello!
I want to know how I can initialize an object, within an object:
ex:

class Panel{
private:
 char xPos;
 char yPos;
 char Length;
 char Width;
public:
 Panel( char X, char Y, char Len, char Wid);
 ~Panel();
};

Panel( char X, char Y, char Len, char Wid);{
 xPos=X;
 yPos=Y;
 Length=Len;
 Width = Wid;
}

class Desktop{
 public:
  Panel Menu(0,0,100,100);
  Panel Icon(0,100,100,100);
}

 that way, it give me an ANSI c++ error.

I know if I do
int main(void){
 Panel Menu(0,0,100,100);
 return(0);
}

without the Desktop class it will work, but I can't do that... I need the
desktop class.

Can anyone help please? thanks



- Raw text -


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