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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,d2e2f8b6578a7759 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-21 18:14:51 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: some simple questions Date: Fri, 21 Feb 2003 20:15:56 -0600 Organization: ENST, France Message-ID: References: Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: avanie.enst.fr 1045880090 26067 137.194.161.2 (22 Feb 2003 02:14:50 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 22 Feb 2003 02:14:50 +0000 (UTC) To: "comp.lang.ada mail to news gateway" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:34407 Date: 2003-02-21T20:15:56-06:00 ----- Original Message ----- From: "Daniel Sch�le" Newsgroups: comp.lang.ada To: Sent: February 21, 2003 4:56 PM Subject: some simple questions > Hi all > > I am learning Ada on doing > I have found some small examples on web and > now I'm trying to put the mosaic stones together > > my questions are > > given > type pint is access integer; > pi: pint:=new integer; > > how do I delete the allocated object? > free(pi); --doesn't work > (I'm pretty sure Ada doesn't have Garabge Collector) You need to instantiate Ada.Unchecked_Deallocation for the type integer. Then you call the instantiated procedure to deallocate the memory. See section 13.11.2 of the Ada Reference Manual. > > is there a syntax available to initialize allocated object (like in C++)? Yes. You would say pi : pint := new Integer'(1234); See sections 4.8 and 4.7 of the Ada Reference Manual. > int * pi=new int(0); > now I am doing that this way > pi.all:=0; > > what is the proper way to assure that pointer points to valid object? > > and last one > what's "std::system("clear");" translated to Ada > (OS Linux) > > sorry if it's faq > > Thanks > > Daniel > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada > >