Article View: be.comp.programming
Article #2333Re: Probleem met strings in C++
From: Kristoffel
Date: Mon, 21 Jun 2004 05:31
Date: Mon, 21 Jun 2004 05:31
30 lines
1931 bytes
1931 bytes
Skender wrote:
> Kristoffel wrote:
>
>
>
> Ik heb wel een destructor gemaakt voor de klasse Gemeente. Dit is de eerste
> destructor die ik schrijf. Ik vermoed dat dat er ongeveer zo moet uit
> zien:
>
> Gemeente::~Gemeente(){
> delete [] naam;
> }
delete naam;
>
> Ik heb m'n code nog eens gelezen, maar ik zie nergens een plaats waar een
> delete nodig is.
>
Wat het attribuut 'naam' betreft: je hebt het niet nodig omdat uw
gemeente objecten verwijderd worden bij het verlaten van het programma.
Uw destructor is wel aan te bevelen.
Ik blijf erbij dat het in strlwr wel een probleem geeft.
Waarom bewaar je de gemeentenaam niet in uppercase ?
--
Kristoffel
Technical Details
Message-ID:
<XouBc.161867$UL1.8209503@phobos.telenet-ops.be>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mailReferences:
<6jKAc.159880$da2.8238210@phobos.telenet-ops.be> <epXAc.160351$_b2.8245342@phobos.telenet-ops.be> <FNXAc.160366$TL1.8208446@phobos.telenet-ops.be> <GXlBc.161622$ar1.8168567@phobos.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,f17987ac718646c6 X-Google-Attributes: gidfcea4,public Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!proxad.net!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail From: Kristoffel <kdg1955@yahoo.com> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: be.comp.programming Subject: Re: Probleem met strings in C++ References: <6jKAc.159880$da2.8238210@phobos.telenet-ops.be> <epXAc.160351$_b2.8245342@phobos.telenet-ops.be> <FNXAc.160366$TL1.8208446@phobos.telenet-ops.be> <GXlBc.161622$ar1.8168567@phobos.telenet-ops.be> In-Reply-To: <GXlBc.161622$ar1.8168567@phobos.telenet-ops.be> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 30 Message-ID: <XouBc.161867$UL1.8209503@phobos.telenet-ops.be> Date: Mon, 21 Jun 2004 05:31:35 GMT NNTP-Posting-Host: 195.130.140.22 X-Complaints-To: abuse@telenet.be X-Trace: phobos.telenet-ops.be 1087795895 195.130.140.22 (Mon, 21 Jun 2004 07:31:35 MEST) NNTP-Posting-Date: Mon, 21 Jun 2004 07:31:35 MEST Organization: Telenet Internet