Article View: alt.comp.lang.learn.c-c++
Article #45Re: Find size of Array?
From: Warren S. Wyght
Date: Tue, 09 Jan 2001 20:45
Date: Tue, 09 Jan 2001 20:45
29 lines
2562 bytes
2562 bytes
I see I am going to have to read up on vectors. Thanks for your help -- Society is produced by our wants, and government by our wickedness; the former promotes our POSITIVELY by uniting our affections, the latter NEGATIVELY by restraining our vices. The one encourages intercourse, the other creates distinctions. The first a patron, the last a punisher. COMMON SENSE Thomas Paine Philadelphia, February 14, 1776 Jon Bell <jtbell@presby.edu> wrote in message news:G6wx0D.Cvs@presby.edu... > Warren S. Wyght <wswyght@telusplanet.net> wrote: > >How do I find the size of an Array once the array was created by either > >malloc or new. > > You can't. You have to keep track of it yourself. Or, instead of using > an array, use std::vector or std::string, both of which keep track of > their sizes, and can tell it to you via the size() member function. > > -- > Jon Bell <jtbell@presby.edu> Presbyterian College > Dept. of Physics and Computer Science Clinton, South Carolina USA > [ Help try to keep the Deja.com archive alive! Sign the petition at ] > [ http://www2.PetitionOnline.com/dejanews/petition.html ]
Technical Details
Message-ID:
<xLK66.2546$FH5.272485@news0.telusplanet.net>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!router1.news.adelphia.net!cyclone.news.idirect.com.MISMATCH!newsfeed.direct.ca!look.ca!cyclone-sjo1.usenetserver.com!news-out.usenetserver.com!newsfeed.telusplanet.net!news0.telusplanet.net.POSTED!not-for-mailReferences:
<MsK66.2480$FH5.269435@news0.telusplanet.net> <G6wx0D.Cvs@presby.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4ba,230db20a608e15f9 X-Google-Attributes: gid10d4ba,public X-Google-Thread: 109fba,230db20a608e15f9 X-Google-Attributes: gid109fba,public X-Google-Thread: fa7a6,230db20a608e15f9 X-Google-Attributes: gidfa7a6,public X-Google-Thread: 114592,230db20a608e15f9 X-Google-Attributes: gid114592,public X-Google-ArrivalTime: 2001-01-09 12:45:32 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!router1.news.adelphia.net!cyclone.news.idirect.com.MISMATCH!newsfeed.direct.ca!look.ca!cyclone-sjo1.usenetserver.com!news-out.usenetserver.com!newsfeed.telusplanet.net!news0.telusplanet.net.POSTED!not-for-mail From: "Warren S. Wyght" <wswyght@telusplanet.net> Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++,no.it.programmering.c++ References: <MsK66.2480$FH5.269435@news0.telusplanet.net> <G6wx0D.Cvs@presby.edu> Subject: Re: Find size of Array? Lines: 31 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: <xLK66.2546$FH5.272485@news0.telusplanet.net> Date: Tue, 09 Jan 2001 20:45:17 GMT NNTP-Posting-Host: 161.184.26.159 X-Trace: news0.telusplanet.net 979073117 161.184.26.159 (Tue, 09 Jan 2001 13:45:17 MST) NNTP-Posting-Date: Tue, 09 Jan 2001 13:45:17 MST