🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51789

initialising member arrs before constructor body

#51789
From: Kaveh Moazami-Goudarzi
Date: Tue, 30 Mar 1993 13:55
36 lines
1488 bytes
     I need to initialise an array of member objects with their
non_default constructor before the body of my class constructor e.g

struct port
{
     port ( char * name , int indx ) {}
     port ( ) {}
};

struct client : public process
{
     port in_ports[10] ;
     process ( char * name ) : process ( name ) , ????? {}
}

     The ????? are where I want to initialise my port array

something like this :

     in_ports[10] = { in_ports ( "in_ports" , 10 ) , }

I can't find the syntax in the books .... please help

thanks in advance

--kaveh
-- 
==================================
	Kaveh Moazami Goudarzi		Email: km2@doc.ic.ac.uk      
	Department of Computing 
	Imperial College
	180 Queensgate
	London SW7 2BZ, U.K.

	Phone:+44-71 589 5111 Ext.  5078
	Fax:  +44-71 581 8024
Technical Details
Message-ID: <1p9jg1INN5ut@frigate.doc.ic.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!dirty.doc.ic.ac.uk!km2

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5dd7f4fa7ef4de48,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-03-30 06:00:35 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!doc.ic.ac.uk!dirty.doc.ic.ac.uk!km2
From: km2@dirty.doc.ic.ac.uk (Kaveh Moazami-Goudarzi)
Newsgroups: gnu.gcc.help
Subject: initialising member arrs before constructor body
Date: 30 Mar 1993 13:55:13 GMT
Organization: Dept. of Computing, Imperial College, University of London, UK.
Lines: 38
Distribution: world
Message-ID: <1p9jg1INN5ut@frigate.doc.ic.ac.uk>
NNTP-Posting-Host: dirty.doc.ic.ac.uk
Keywords: arrays initialisation constructors