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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,345a8b767542016e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-20 12:42:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!not-for-mail From: "Bertrand Augereau" Newsgroups: comp.lang.ada Subject: Re: memory leakages with Ada? Date: Wed, 20 Mar 2002 21:49:25 +0100 Organization: Wanadoo, l'internet avec France Telecom Message-ID: References: <3c90af1e@news.starhub.net.sg> <3c91bfa3.1987537@news.demon.co.uk> <3C9629E3.8030109@home.com> Reply-To: "Bertrand Augereau" NNTP-Posting-Host: afontenayssb-103-1-5-161.abo.wanadoo.fr X-Trace: wanadoo.fr 1016656929 21161 80.11.191.161 (20 Mar 2002 20:42:09 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 20 Mar 2002 20:42:09 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Xref: archiver1.google.com comp.lang.ada:21499 Date: 2002-03-20T20:42:09+00:00 List-Id: > This was actually one of my first observations when I started learning Ada95. > A C function does not have a simple way to return a string (a few basic > choices exist, though one can vary the theme somewhat). C++ gets around this > with objects, but they end up resorting to malloc() inside of the object to > carry this off. (excuse the lack of const keywords in these C examples) : There's no "getting around" in C++, you have std::string which is a standard object. And you don't use "malloc", but "new" in C++.