[Dev-C++] =?iso-8859-1?Q?RE:_[Dev-C++]_Number_of_elements_of_a_multidimensional_array?=
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <mar...@te...> - 2002-11-28 12:37:07
|
I think what Luc wants is a kind of run-time range control. Almost everyo= ne new to C misses it. There couldn't be such functions, and the reason i= s simple: most C software is based on the ability to surpass range bounds= . Keeping control of the bounds yourself is what you have to do, everytim= e you use low level arrays.=0D=0A=0D=0AI recommend using STL containers l= ike vector<>. Use it to write your own matrix<T> templates, it's not hard= to do. So you'll have all the controls you can use, with a very little o= verhead, if any.=0D=0A=0D=0AMMP=0D=0A=0D=0A=0D=0ADe:dev-cpp-users-admin@l= ists.sourceforge.net=0D=0APara:dev...@li...=0D=0AC= =F3pia:=0D=0AData:Thu, 28 Nov 2002 12:09:36 +0000=0D=0AAssunto:RE: [Dev-C= ++] Number of elements of a multidimensional array=0D=0A=0D=0A> Is there = not a C function that can do this?=0D=0A> =0D=0A> failing that, set an in= teger and use a while loop. something like=0D=0A> =0D=0A> // iterate thro= ugh array using whatever function it is, MoveNext or =0D=0A> whatever.=0D= =0A> // increment the integer.=0D=0A> // check for '/0'=0D=0A> // iterate= again=0D=0A> =0D=0A> something like that I guess.=0D=0A> =0D=0A> =0D=0A>= =0D=0A> >From: Juliano P=E1vel Brasil Cust=F3dio =0D=0A> >To: =0D=0A> >S= ubject: RE: [Dev-C++] Number of elements of a multidimensional array=0D=0A= > >Date: Thu, 28 Nov 2002 09:26:23 -0300=0D=0A> >=0D=0A> > So far as I kn= ow, it is not possible to do what you want. The=0D=0A> >programmer must c= ontrol the size of this kind of array so he can=0D=0A> >manipulate it. If= it wasn't a pointer you could achieve it by dividing=0D=0A> >the array b= y the size of one single element or something like this... Or=0D=0A> >if = you stored Null terminated strings you could search for the '\0'=0D=0A> >= character... Beyond this two cases, I don't know if it's possible, but=0D= =0A> >if someone else know any way, I'd like to know it too.=0D=0A> >=0D=0A= > > Juliano=0D=0A> >=0D=0A> >-----Original Message-----=0D=0A> >From: dev= -cpp...@li...=0D=0A> >[mailto:dev-cpp-users-admi= n...@li...] On Behalf Of Luc=0D=0A> >Saint-Elie=0D=0A> >Sent= : quinta-feira, 28 de novembro de 2002 06:35=0D=0A> >To: dev-cpp-users@li= sts.sourceforge.net=0D=0A> >Subject: [Dev-C++] Number of elements of a mu= ltidimensional array=0D=0A> >=0D=0A> >=0D=0A> >Venha para a VilaBOL!=0D=0A= > >O melhor lugar para voc=EA construir seu site. F=E1cil e gr=E1tis!=0D=0A= > >http://vila.bol.com.br Hello,=0D=0A> >=0D=0A> >I know this is a basic = question...=0D=0A> >How can I know the number of elements of a multidimen= sional array (char=0D=0A> >**result) ?=0D=0A> >=0D=0A> >Thanks in advance= =0D=0A> >=0D=0A> >Luc=0D=0A> >=0D=0A> >=0D=0A> >=0D=0A> >----------------= ---------------------------------------=0D=0A> >This SF.net email is spon= sored by: Get the new Palm Tungsten T=0D=0A> >handheld. Power & Color in = a compact size!=0D=0A> >http://ads.sourceforge.net/cgi-bin/redirect.pl?pa= lm0002en=0D=0A> >_______________________________________________=0D=0A> >= Dev-cpp-users mailing list=0D=0A> >Dev...@li...=0D= =0A> >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm=0D=0A> >htt= ps://lists.sourceforge.net/lists/listinfo/dev-cpp-users=0D=0A> >=0D=0A> >= =0D=0A> >=0D=0A> >=0D=0A> >=0D=0A> >-------------------------------------= ------------------=0D=0A> >This SF.net email is sponsored by: Get the new= Palm Tungsten T=0D=0A> >handheld. Power & Color in a compact size!=0D=0A= > >http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0002en=0D=0A> >____= ___________________________________________=0D=0A> >Dev-cpp-users mailing= list=0D=0A> >Dev...@li...=0D=0A> >TO UNSUBSCRIBE:= http://www.noicys.cjb.net/devcpp/ub.htm=0D=0A> >https://lists.sourceforg= e.net/lists/listinfo/dev-cpp-users=0D=0A> =0D=0A> =0D=0A> _______________= __________________________________________________=0D=0A> STOP MORE SPAM = with the new MSN 8 and get 2 months FREE* =0D=0A> http://join.msn.com/?pa= ge=3Dfeatures/junkmail=0D=0A> =0D=0A> =0D=0A> =0D=0A> -------------------= ------------------------------------=0D=0A> This SF.net email is sponsore= d by: Get the new Palm Tungsten T =0D=0A> handheld. Power & Color in a co= mpact size! =0D=0A> http://ads.sourceforge.net/cgi-bin/redirect.pl?palm00= 02en=0D=0A> _______________________________________________=0D=0A> Dev-cp= p-users mailing list=0D=0A> Dev...@li...=0D=0A> TO= UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm=0D=0A> https://list= s.sourceforge.net/lists/listinfo/dev-cpp-users=0D=0A> =0D=0A> |