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-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newshub.sdsu.edu!news.zanker.org!newsfeed00.sul.t-online.de!t-online.de!frankfurt1.telia.de!newsfeed.kamp.net!news.icp.pl!newsfeed.atman.pl!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "Robert Kawulak" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Wed, 29 Sep 2004 20:08:49 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <41547dae$0$91007$39cecf19@news.twtelecom.net> <1g2d9xmnita9f.5ecju0eftkqw$.dlg@40tude.net> NNTP-Posting-Host: pr170.krakow.cvx.ppp.tpnet.pl X-Trace: nemesis.news.tpi.pl 1096482489 12281 213.76.42.170 (29 Sep 2004 18:28:09 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Wed, 29 Sep 2004 18:28:09 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:4400 Date: 2004-09-29T20:08:49+02:00 List-Id: Hi, > : Of course C++ has got arrays inherited from C which are the core > language > : construct, > > Prior to C99, functions had no means to know how many > floats there were in the "array" argument: > > float foo(float a[]); And that's where the second part of the quoted sentence applies: "and std::vector<> (...)". In C++, C-style arrays are really meant to be used mostly for "low-level of abstraction" coding. And the recommended way to solve your problem is: float foo(float a[], size_t a_size); But please don't tell me this is ugly and error-prone etc. It *is*, that's why there are std::vector<> and std::valarray<>. Best regards, Robert Kawulak