Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #6117

Re: Problem with array objects

From Pete Becker <pete@versatilecoding.com>
Organization Roundhouse Consulting, Ltd.
Newsgroups comp.lang.c++
Date 2011-06-02 16:21 -1000
Message-ID <2011060216212430425-pete@versatilecodingcom> (permalink)
References (18 earlier) <sdSFp.31195$ue1.24404@newsfe28.ams2> <2011060210342271730-pete@versatilecodingcom> <S4WFp.45689$m_1.7467@newsfe22.ams2> <2011060216061983880-pete@versatilecodingcom> <2011060216124975452-pete@versatilecodingcom>
Subject Re: Problem with array objects

Show all headers | View raw


> 
>> On 2011-06-02 14:41:16 -1000, Paul said:
>> 
>>> "Pete Becker" <pete@versatilecoding.com> 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)

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-26 14:38 -0500
  Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-05-26 21:15 +0100
    Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-27 12:43 -0500
      Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-05-27 20:20 +0100
        Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-28 11:41 -0500
          Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-05-28 19:10 +0100
            Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-05-31 12:26 -0500
              Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-05-31 20:49 +0100
                Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-06-01 12:46 -0500
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-01 20:26 +0100
                Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-06-02 12:36 -0500
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-02 20:23 +0100
                Re: Problem with array objects Pete Becker <pete@versatilecoding.com> - 2011-06-02 10:34 -1000
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-03 01:41 +0100
                Re: Problem with array objects Pete Becker <pete@versatilecoding.com> - 2011-06-02 16:06 -1000
                Re: Problem with array objects Pete Becker <pete@versatilecoding.com> - 2011-06-02 16:12 -1000
                Re: Problem with array objects Pete Becker <pete@versatilecoding.com> - 2011-06-02 16:21 -1000
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-03 14:17 +0100
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-04 10:34 -0700
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-04 10:45 -0700
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-04 21:02 +0100
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-04 14:11 -0700
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-04 22:35 +0100
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-04 15:43 -0700
                Re: Problem with array objects "io_x" <a@b.c.invalid> - 2011-06-05 06:39 +0200
                Re: Problem with array objects "io_x" <a@b.c.invalid> - 2011-06-05 07:55 +0200
                Re: Problem with array objects "Alf P. Steinbach /Usenet" <alf.p.steinbach+usenet@gmail.com> - 2011-06-03 11:14 +0200
                Re: Problem with array objects Ian Collins <ian-news@hotmail.com> - 2011-06-03 21:08 +1200
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-03 14:25 +0100
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-04 10:52 -0700
                Re: Problem with array objects Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-04 19:52 -0700
                Re: Problem with array objects Leigh Johnston <leigh@i42.co.uk> - 2011-06-05 13:48 +0100
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-05 14:52 +0100
                Re: Problem with array objects "Thomas J. Gritzan" <phygon_antispam@gmx.de> - 2011-06-05 18:03 +0200
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-05 19:23 +0100
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-05 14:49 +0100
                Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-06-03 12:37 -0500
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-03 19:49 +0100
                Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-06-04 11:46 -0500
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-04 18:42 +0100
                Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-06-06 14:27 -0500
                Re: Problem with array objects Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-06 14:04 -0700
                Re: Problem with array objects Joshua Maurice <joshuamaurice@gmail.com> - 2011-06-06 14:04 -0700
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-07 02:26 +0100
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-06 23:30 -0700
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-07 13:13 +0100
                Re: Problem with array objects hanukas <jukka@liimatta.org> - 2011-06-08 01:20 -0700
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-08 11:39 +0100
                Re: Problem with array objects "A. Bolmarcich" <aggedor@earl-grey.cloud9.net> - 2011-06-08 17:03 -0500
                Re: Problem with array objects "Paul" <pchristor@yahoo.co.uk> - 2011-06-08 23:51 +0100

csiph-web