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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a4a47df08547ee16 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Strange problem Date: 2000/01/04 Message-ID: <387271e1_1@news1.prserv.net>#1/1 X-Deja-AN: 568346156 Distribution: world Content-transfer-encoding: 7bit References: <946581540.11snx@jvdsys.stuyts.nl> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 4 Jan 2000 22:19:13 GMT, 32.101.8.39 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-04T00:00:00+00:00 List-Id: In article <946581540.11snx@jvdsys.stuyts.nl> , jerry@jvdsys.stuyts.nl (Jerry van Dijk) wrote: > In article jankr@nntp.ifi.uio.no writes: > > Ada: > > with Interfaces.C.Strings; > > procedure Demo is ... Here's an alternative implementation that does not require the use of heap: with Interfaces.C; procedure Demo is package C renames Interfaces.C; use type C.size_t; procedure C_Func (s : C.char_array; len : C.size_t); pragma Import (C, C_Func, "c_func"); Str : constant C.char_array := C.To_C ("Hello, world!"); begin C_Func (Str, Str'Length - 1); end Demo;