Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 31 May 2011 14:38:22 -0500 From: Pete Becker Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Tue, 31 May 2011 09:38:22 -1000 Message-ID: <2011053109382252743-pete@versatilecodingcom> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: Problem with array objects User-Agent: Unison/2.1.4 Lines: 50 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Mbuajy2sNXyWogQWe0r+rfl26qmJ/Va+7fT7sdx0DzdTJFtLNYushMx9f2i3s1CNstyEos3SuJS0/Re!Qw4lnZWhYzhXElUbuHCOlp0tbDxunqUdNvyAWQH6JjP/UUw+x0f3xgOtx4mVtM3qupPMuIA= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2847 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5917 On 2011-05-30 19:05:59 -1000, Paul said: > "Pete Becker" wrote in message > news:2011053017391493970-pete@versatilecodingcom... >> On 2011-05-30 16:08:47 -1000, Paul said: >> >>> "Leigh Johnston" wrote in message >>> news:S4adnVSluPkhLH_QnZ2dnUVZ7tednZ2d@giganews.com... >>>> On 29/05/2011 20:43, Paul wrote: >>>> >>>> [snip] >>>> >>>>> A pointer to an array of integer objects is of type int*. >>>> >>>> Wrong; 'int*' is a pointer to a single 'int' not an array of 'int'. >>>> >>>> [snip] >>>> >>> No I am not wrong, int* can point to a single int or an array of >>> integers as shown : >>> >>> int* p_arr= new int[66]; >>> >>> In C++ a pointer to an array of T's is used to access the array with >>> the subscripting syntax T[N], where N is the, zero based, Nth element >>> of the array. >> >> In C++ a pointer to a single value of type T can be used to access the >> value with the subscripting syntax ip[0]. A pointer to int points to >> (wait for it...) an int. >> > > In the expression : > int* p_arr= new int[66]; > the pointer points to an array of integers, not a single integer. > > Yes you could say that the pointer only points to one single integer, > but it also points to the array of integers. > To suggest that it points to one single integer and only one single > integer is incorrect, narrow minded and ignorant of the fact that it > actually points to an array of integers. Can you say "straw man"? There, I knew you could. -- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)