From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e7d4f2a40929e50c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-22 07:16:47 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!attbi_s04.POSTED!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: <4948f537.0311220139.570c8a4e@posting.google.com> Subject: Re: array and pointers X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: NNTP-Posting-Host: 12.211.58.135 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s04 1069514201 12.211.58.135 (Sat, 22 Nov 2003 15:16:41 GMT) NNTP-Posting-Date: Sat, 22 Nov 2003 15:16:41 GMT Organization: Comcast Online Date: Sat, 22 Nov 2003 15:16:46 GMT Xref: archiver1.google.com comp.lang.ada:2848 Date: 2003-11-22T15:16:46+00:00 List-Id: To create a new dynamically allocated array and initialize it with the result from Array_Filter use: N := new Arr'( Array_Filter( A ) ); Also, since you say you're new to Ada, I'll also mention that this is an unusual way of doing things in Ada. A more common approach is to use something like: declare Filtered_Data : Arr := Array_Filter( A ); begin -- Do stuff with Filtered_Data here end; Which avoids dynamic allocation on the heap altogether. Steve (The Duck) "shoko" wrote in message news:4948f537.0311220139.570c8a4e@posting.google.com... > hi > i am new in ada > my question is: > i have a function that returns unconstrained array > i am tring to create a pointer to the new array > could somone help me: > > what is wwrong in the following code?: > > type Arr is Array(Item range<>) of Integer; > a:Arr:=(1,2,2,2,3,4,3) ; > type n_array_Ptr is access Arr; > n: n_array_Ptr; > > begin > n:= new Array_filter(a); > > put_line("hello");