🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14002

DynamicArray pointer?

#14002
From: Majo Petrik
Date: Tue, 02 Sep 2003 11:29
22 lines
2023 bytes
Hello,

I use a DynamicArray template type variable and I want another variable of
the same type (shorter array) to copy its content for example from index 5
to index 10.
Simple copying or CopyRange() is just too slow for me, so I wanted to use
pointers - shorter array (the one I am copying to) would be a pointer to DA
template (with allocated memory of course) and I would just set it's pointer
to 5th item of the wider array(the one I am copying from).
This doesn't seem to work, because I can't set pointer of a shorter array to
specified index of item in the wider array.
DynamicArray template is a class, not an array.
Well I can set pointer of the first item in sh.ar. to the index of specified
item in wider array, but it's a 'copy' of just one item.
I'd like to 'copy' all items I want making just ONE step.
Like I would using static arrays.

Or: Is there an another, not much complicated, way of using dynamic arrays
(length may be changed in runtime) in C++Builder?

(It's stupid, that Delphi has dynamic arrays implemented in the core and
C++B uses just template exported from Delphi)
Technical Details
Message-ID: <3f547f41@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5ff86197fe27a8e1,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-02 04:36:36 PST
Reply-To: "Majo Petrik" <majko@europe.com>
From: "Majo Petrik" <majko@europe.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: DynamicArray pointer?
Date: Tue, 2 Sep 2003 13:29:56 +0200
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 217.118.103.253
Message-ID: <3f547f41@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1062502209 217.118.103.253 (2 Sep 2003 04:30:09 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail