Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: Thomas David Rivers Newsgroups: comp.lang.c++ Subject: Re: Problem with array objects Date: Thu, 26 May 2011 14:45:33 -0400 Organization: Aioe.org NNTP Server Lines: 43 Message-ID: <4DDE9FCD.9050005@dignus.com> References: <846dndOds94DPEbQnZ2dnUVZ8ridnZ2d@giganews.com> <5cadnQfIzuppjUHQnZ2dnUVZ8kidnZ2d@giganews.com> <805Dp.26220$7H.26163@newsfe08.ams2> <4DDD0AE0.9080001@dignus.com> <4DDD34A8.6030005@dignus.com> <4VdDp.17340$h35.4417@newsfe19.ams2> <4DDD9893.9060502@dignus.com> <4DDE50C0.1080402@dignus.com> <8ktDp.17767$h35.800@newsfe19.ams2> NNTP-Posting-Host: 5vmandCOS2XnoG0+Ic8whg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20061027 X-Accept-Language: en-us, en X-Notice: Filtered by postfilter v. 0.8.2 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5641 Paul wrote: > >> >> So - do we agree that an array is a contigous set of like-typed >> elements, >> where the elements are accessed via the []-operator? >> > Yes I aggree with that. > So - next let's examine a rather simple declaration of an array in C/C++. int arr[5]; What does this define. This defines a contiguous set of 5 `int' elements. The name of that set is 'arr'. What is the type of 'arr'? It is an array of 5 'int' elements. What is 'arr'? 'arr' represents, at execution time, a set of 5 contigous 'int' elements. The name 'arr' is used to refer to the runtime location of that set of elements. We can colloquially use the term, the "address" of the set of 5 contiguous 'int' elements when we talk about the runtime location of the set of 5 contiguous 'int' elements. That is, the name 'arr' refers to the runtime location (or "address") of the set of 5 contiguous 'int' elements. Does that sound right so far? - Dave Rivers - -- rivers@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com