Article View: comp.lang.c++.leda
Article #97Re: data members of type "a LEDA type" / deriving from a LEDA type
From: Marco Nissen
Date: Tue, 26 Sep 1995 07:47
Date: Tue, 26 Sep 1995 07:47
28 lines
1154 bytes
1154 bytes
Bulent Basaran (basaran@prelude.ece.cmu.edu) wrote this:
: 1) Is it possible to have a data member of a user class with a LEDA type?
: e.g.,
: class C1{
: array<string> A(0, 10); // an array of strings
: };
: This is not a valid c++ statement, since data members can not be initialized.
: Is there a way to correctly implement this?
I'd say ...
class C1 {
array<string> A;
public:
C1() : A(0,10) {}
void test() {
cout << "low: " << A.low() << " high: " << A.high() << endl; }
};
C1 test;
test.test();
--
Marco Nissen [http://www.mpi-sb.mpg.de/~marco]
*this posting was not sponsered by microsoft*
Technical Details
Message-ID:
<448b77$d9h@coli-gate.coli.uni-sb.de>Path:
arc1-ca.pugleaf.net!news.coli.uni-sb.de!not-for-mailReferences:
<199509251541.LAA02912@prelude.ece.cmu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.coli.uni-sb.de!not-for-mail From: manis@coli.uni-sb.de (Marco Nissen) Newsgroups: comp.lang.c++.leda Subject: Re: data members of type "a LEDA type" / deriving from a LEDA type Date: 26 Sep 1995 08:47:51 +0100 Organization: Hello World Message-ID: <448b77$d9h@coli-gate.coli.uni-sb.de> References: <199509251541.LAA02912@prelude.ece.cmu.edu> Reply-To: marco@mpi-sb.mpg.de NNTP-Posting-Host: coli-gate.coli.uni-sb.de X-Newsreader: TIN [version 1.2 PL2]