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


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

Re: Problem with array objects

From Pete Becker <pete@versatilecoding.com>
Organization Roundhouse Consulting, Ltd.
Newsgroups comp.lang.c++
Date 2011-06-02 16:12 -1000
Message-ID <2011060216124975452-pete@versatilecodingcom> (permalink)
References <lHdip.162437$OU.122874@newsfe02.ams2> <2011060216061983880-pete@versatilecodingcom>
Subject Re: Problem with array objects

Show all headers | View raw


On 2011-06-02 16:06:19 -1000, Pete Becker said:

> 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)
>> int arr2[16];
>> These are ints(plural)
>> A pointer to all these ints can be, and usually is, of type int*.
> 
> A pointer to any of these ints is of type int*. There is no single 
> pointer to all of these ints.
> 
>> 
>> A pointer references a memory location and when its dereferenced we get 
>> the value from that location.
>> You cannot reference a whole array unless you have an array of 
>> pointers. You can only represent a pointer to the whole array using the 
>> C++ type system.
>> 
>> I can appreciate both pointer types as pointing to an array of objects, 
>> in different ways. I do not think that an int* cannot point to an array 
>> of int objects.
> 
> Which is what I said above: an int* points to an int. It does not point 
> to an array of int objects, because an array of int objects is not an 
> int.

Whoops, misread the double negative. I said the opposite, and merely 
re-asserting your claim that you disagree doesn't contribute to the 
discussion. The C++ language definition tells you what the type of a 
pointer is in C++; if you think it should mean something else then you 
belong in a different newsgroup.

-- 
  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