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: Mon, 30 May 2011 22:39:14 -0500 From: Pete Becker Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Mon, 30 May 2011 17:39:14 -1000 Message-ID: <2011053017391493970-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: 33 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-DJy75S+BIRCwnvOWGtRP1yt1iHFjQp/1+4iVvmN9tNVEmPAGYKET5Zzoe1yItWa3SfqysMRc9redE9f!mQbwJwHFXoeV6bPsrT3K67k3FHd/bkQyY+ep9hOnHTh3NKKo7puyZY0Q2nqs/XmU/wbFuKA= 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: 2131 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:5870 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. -- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)