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: Thu, 02 Jun 2011 21:21:24 -0500 From: Pete Becker Organization: Roundhouse Consulting, Ltd. Newsgroups: comp.lang.c++ Date: Thu, 2 Jun 2011 16:21:24 -1000 Message-ID: <2011060216212430425-pete@versatilecodingcom> References: <2011060210342271730-pete@versatilecodingcom> <2011060216061983880-pete@versatilecodingcom> <2011060216124975452-pete@versatilecodingcom> 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: 35 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-rYLMfWtzRsZkIX9sJbDYdjZ3PGSArCF09MM7VNqBMvuP7cgCepoTEqJEORu6anQFzSTUOw/TQ7XYeM0!2ffQDn4U+HB+pbPXZTEUHSA3WuJcaMXbvIYJuvliQKE5vFBcQ9Se9YO3C8HoePPvCvY5gXQ= 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: 3133 Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:6117 > >> On 2011-06-02 14:41:16 -1000, Paul said: >> >>> "Pete Becker" wrote in message >>> news:2011060210342271730-pete@versatilecodingcom... >>>> On 2011-06-02 09:23:12 -1000, Paul said: >>>> >>>>> >>>>> I am simply trying to get to the bottom of why you think a pointer of >>>>> type int* cannot point to an array of integer objects. >>>> >>>> The reason is simple: a pointer of type int* points to an int. That's >>>> what int* means. An int is not an array of integer objects. >>>> >>> int arr1[1]; >>> This is an int(singular) 'arr1' is not an int. It is an array of 1 int. >>> int arr2[16]; >>> These are ints(plural) 'arr2' is an array of sixteen ints. Don't be confused by the fact that the name of an array usually decays into a pointer to its first element. That's just a conversion, and being able to convert one type into another does not make the two types the same. -- Pete Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The Standard C++ Library Extensions: a Tutorial and Reference (www.petebecker.com/tr1book)