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


Groups > comp.lang.c++ > #2801 > unrolled thread

Re: delete[] p or delete[] *p

Started byGoran <goran.pusic@gmail.com>
First post2011-03-29 10:27 -0700
Last post2011-03-31 23:08 +0000
Articles 20 on this page of 196 — 15 participants

Back to article view | Back to comp.lang.c++

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-29 10:27 -0700
    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-29 23:32 +0100
      Re: delete[] p or delete[] *p Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-03-30 01:53 +0200
        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 03:55 +0100
          Re: delete[] p or delete[] *p Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-03-30 09:52 +0200
            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 11:44 +0100
              Re: delete[] p or delete[] *p Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-03-30 19:44 +0200
                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 20:18 +0100
          Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-03-30 04:30 -0400
          Re: delete[] p or delete[] *p Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-03-30 10:33 +0200
            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 11:39 +0100
            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 15:38 +0100
              Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-30 16:14 +0100
                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 18:06 +0100
                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-30 18:15 +0100
                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 18:22 +0100
                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-30 18:38 +0100
                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 00:42 +0100
                          Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-31 00:52 +0100
                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 02:22 +0100
                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 23:44 -0700
                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 10:52 +0100
                                  Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-03-31 06:13 -0400
                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-31 04:00 -0700
                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 14:14 +0100
                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-31 07:01 -0700
                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 15:55 +0100
                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-31 08:10 -0700
                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 18:20 +0100
                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-01 01:14 -0700
                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-01 11:53 +0100
                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-01 05:11 -0700
                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-01 15:32 +0100
                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-01 11:24 -0700
                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-02 01:55 +0100
                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-02 23:32 -0700
                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-03 13:21 +0100
                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-04 02:47 -0700
                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-04 13:33 +0100
                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-04 11:06 -0700
                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-04 20:17 +0100
                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-05 05:00 -0700
                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-05 15:59 +0100
                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-06 03:08 -0700
                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-06 16:24 +0100
                                                                              Re: delete[] p or delete[] *p boltar2003@boltar.world - 2011-04-06 15:36 +0000
                                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-06 10:23 -0700
                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-06 18:53 +0100
                                                                                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-06 19:01 +0100
                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-06 19:24 +0100
                                                                                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-06 19:30 +0100
                                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-06 11:53 -0700
                                                                                    Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-04-06 17:31 -0400
                                                                                      Re: delete[] p or delete[] *p Ian Collins <ian-news@hotmail.com> - 2011-04-07 09:47 +1200
                                                                                      Re: delete[] p or delete[] *p Joshua Maurice <joshuamaurice@gmail.com> - 2011-04-06 15:14 -0700
                                                                                        Re: delete[] p or delete[] *p Joshua Maurice <joshuamaurice@gmail.com> - 2011-04-06 15:15 -0700
                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-06 23:13 +0100
                                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-06 23:35 -0700
                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-07 14:20 +0100
                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-07 12:56 -0700
                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-07 21:47 +0100
                                                                                              Re: delete[] p or delete[] *p Lasse Reichstein Nielsen <lrn.unread@gmail.com> - 2011-04-08 06:54 +0200
                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 08:45 +0100
                                                                                                  Re: delete[] p or delete[] *p Lasse Reichstein Nielsen <lrn.unread@gmail.com> - 2011-04-08 18:01 +0200
                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 18:09 +0100
                                                                                                      Re: delete[] p or delete[] *p Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2011-04-08 20:25 +0200
                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 19:45 +0100
                                                                                                          Re: delete[] p or delete[] *p Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2011-04-08 21:14 +0200
                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 21:08 +0100
                                                                                                              Re: delete[] p or delete[] *p Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2011-04-08 22:52 +0200
                                                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-08 00:52 -0700
                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 09:06 +0100
                                                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-08 07:53 -0700
                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 18:12 +0100
                                                                                                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-08 18:22 +0100
                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 19:51 +0100
                                                                                                          Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-08 19:54 +0100
                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-08 21:10 +0100
                                                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-10 23:44 -0700
                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-11 12:40 +0100
                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-11 04:53 -0700
                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-11 14:05 +0100
                                                                                                              Re: delete[] p or delete[] *p gwowen <gwowen@gmail.com> - 2011-04-11 06:20 -0700
                                                                                                              Re: delete[] p or delete[] *p Goran Pusic <goranp@cse-semaphore.com> - 2011-04-11 07:33 -0700
                                                                                                                Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-04-11 11:42 -0400
                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-11 17:56 +0100
                                                                                                                  Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-04-11 13:16 -0400
                                                                                                                    Re: delete[] p or delete[] *p Ian Collins <ian-news@hotmail.com> - 2011-04-12 08:09 +1200
                                                                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-12 00:19 -0700
                                                                                                                    Re: delete[] p or delete[] *p SG <s.gesemann@gmail.com> - 2011-04-12 04:04 -0700
                                                                                                                      Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-12 13:49 +0100
                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-12 13:41 +0100
                                                                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-12 06:48 -0700
                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-12 17:20 +0100
                                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-12 23:43 -0700
                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-13 11:24 +0100
                                                                                                                              Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-04-13 07:13 -0400
                                                                                                                                Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-04-13 07:19 -0400
                                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-13 08:31 -0700
                                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-13 23:30 -0700
                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-14 13:50 +0100
                                                                                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-14 07:28 -0700
                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-14 16:26 +0100
                                                                                                                                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-14 18:02 +0100
                                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-14 19:08 +0100
                                                                                                                                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-14 19:45 +0100
                                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-14 20:55 +0100
                                                                                                                                          Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-14 21:10 +0100
                                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-14 23:04 +0100
                                                                                                                                              Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-14 23:24 +0100
                                                                                                                                                Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-14 23:31 +0100
                                                                                                                                                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-14 23:33 +0100
                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 01:28 +0100
                                                                                                                                                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 13:31 +0100
                                                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 14:24 +0100
                                                                                                                                                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 14:34 +0100
                                                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 14:49 +0100
                                                                                                                                                          Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 14:58 +0100
                                                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 16:43 +0100
                                                                                                                                                              Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 17:52 +0100
                                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 18:55 +0100
                                                                                                                                                                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 19:28 +0100
                                                                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 19:43 +0100
                                                                                                                                                                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 19:55 +0100
                                                                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 22:19 +0100
                                                                                                                                                                          Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-04-15 22:27 +0100
                                                                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 22:53 +0100
                                                                                                                                              Re: delete[] p or delete[] *p crisgoogle <crisd@telus.net> - 2011-04-14 15:28 -0700
                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 01:11 +0100
                                                                                                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 01:35 -0700
                                                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 12:24 +0100
                                                                                                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 05:06 -0700
                                                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 13:19 +0100
                                                                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 06:37 -0700
                                                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 14:52 +0100
                                                                                                                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 06:54 -0700
                                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 16:45 +0100
                                                                                                                                                        Re: delete[] p or delete[] *p gwowen <gwowen@gmail.com> - 2011-04-15 05:56 -0700
                                                                                                                                                          Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 14:30 +0100
                                                                                                                                              Re: delete[] p or delete[] *p Ian Collins <ian-news@hotmail.com> - 2011-04-15 10:44 +1200
                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 00:14 +0100
                                                                                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 01:22 -0700
                                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 12:35 +0100
                                                                                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 05:05 -0700
                                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 13:26 +0100
                                                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-15 06:35 -0700
                                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-15 16:48 +0100
                                                                                                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-17 08:50 -0700
                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-17 18:28 +0100
                                                                                                                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-19 01:16 -0700
                                                                                                                                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-19 11:42 +0100
                                                                                                                                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-19 05:02 -0700
                                                                                                                                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-20 16:29 +0100
                                                                                                                                                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-21 05:09 -0700
                                                                                                                                                            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-21 18:24 +0100
                                                                                                                                                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-21 23:23 -0700
                                                                                                                                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-22 09:34 +0100
                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-01 05:36 -0700
                                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-04-01 12:52 +0100
                                                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-04-01 05:46 -0700
                                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-31 07:21 -0700
                              Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-31 13:04 +0100
                                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 14:16 +0100
                                  Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-31 14:26 +0100
                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 14:37 +0100
                                      Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-31 14:44 +0100
                      Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-03-30 16:04 -0400
                        Re: delete[] p or delete[] *p Joshua Maurice <joshuamaurice@gmail.com> - 2011-03-30 14:04 -0700
              Re: delete[] p or delete[] *p Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-03-30 20:02 +0200
                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 20:21 +0100
                  Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-03-30 15:47 -0400
      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 00:12 -0700
        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 11:36 +0100
          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 05:26 -0700
            Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 13:41 +0100
              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 06:28 -0700
                Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 15:00 +0100
                  Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 07:47 -0700
                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 18:14 +0100
                      Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 10:33 -0700
                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-30 20:24 +0100
                          Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-30 23:31 -0700
                            Re: delete[] p or delete[] *p SG <s.gesemann@gmail.com> - 2011-03-31 04:46 -0700
                              Re: delete[] p or delete[] *p Goran <goran.pusic@gmail.com> - 2011-03-31 05:16 -0700
                              Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 14:28 +0100
                                Re: delete[] p or delete[] *p SG <s.gesemann@gmail.com> - 2011-03-31 09:01 -0700
                                  Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 18:23 +0100
                                  Re: delete[] p or delete[] *p Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2011-03-31 21:32 +0200
                                    Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-31 20:37 +0100
                                    Re: delete[] p or delete[] *p cg_chas <cg_chas@hotmail.com> - 2011-03-31 16:13 -0400
                                    Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 21:28 +0100
                                      Re: delete[] p or delete[] *p Peter Remmers <p.remmers@expires-2011-04-30.arcornews.de> - 2011-03-31 22:55 +0200
                                        Re: delete[] p or delete[] *p "Paul" <pchristor@yahoo.co.uk> - 2011-03-31 23:06 +0100
                                          Re: delete[] p or delete[] *p Leigh Johnston <leigh@i42.co.uk> - 2011-03-31 23:43 +0100
                                            Re: delete[] p or delete[] *p Ian Collins <ian-news@hotmail.com> - 2011-04-01 12:12 +1300
                                    Re: delete[] p or delete[] *p drew@furrfu.invalid (Drew Lawson) - 2011-03-31 23:08 +0000

Page 6 of 10 — ← Prev page 1 … 4 5 [6] 7 8 … 10  Next page →


#3669

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-14 13:50 +0100
Message-ID<34Cpp.5463$Y71.4950@newsfe17.ams2>
In reply to#3644
"Goran" <goran.pusic@gmail.com> wrote in message 
news:5c2c27e8-e02d-4818-9be0-7afb3a1796a9@hd10g2000vbb.googlegroups.com...
On Apr 12, 6:20 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> Ok, so it's a fact that it's a pointer to an array. And one can assign
> address of a single int to it, too (that's a fact, too). So pointer is
> now not a pointer to an array.
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> This would be correct.
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> Therefore, your fact is in conflict
> with itself. Therefore, your fact is nonsense.
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> No your conclusion is nonsense, the same pointer can point to a single int
> or and array of int.

No, conclusion is fine. Nonsense are your attempts to equal "is" and
"points to". And, they lead to poor coding and errors (see your own
attempts earlier in this thread to explain your stance).
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Do you accept that the same pointer-type can point to an char or an array of 
char's?

Or do you somehow feel that you are equally as special as cg_chas and its 
quite ok for you to dismiss Stroustrup and others experts as bullshitters 
who dont know what they're talking about?

[toc] | [prev] | [next] | [standalone]


#3676

FromGoran <goran.pusic@gmail.com>
Date2011-04-14 07:28 -0700
Message-ID<149c55b8-2efb-4c39-913e-e6d204cb9676@o21g2000prh.googlegroups.com>
In reply to#3669
On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> No, conclusion is fine. Nonsense are your attempts to equal "is" and
> "points to". And, they lead to poor coding and errors (see your own
> attempts earlier in this thread to explain your stance).
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Do you accept that the same pointer-type can point to an char or an array of
> char's?

I accept that when pointer points to the first element of an array, we
commonly say that it points to an array.

But in

int a[1];
int (*p)[1] = &a;

p is an actual, in C type system sense, pointer to an array. And
because of such things, one should take mental note when saying
"pointer to an array" for a pointer pointing to array's first element.

Goran.

[toc] | [prev] | [next] | [standalone]


#3678

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-14 16:26 +0100
Message-ID<ymEpp.51550$7u3.47048@newsfe04.ams2>
In reply to#3676
"Goran" <goran.pusic@gmail.com> wrote in message 
news:149c55b8-2efb-4c39-913e-e6d204cb9676@o21g2000prh.googlegroups.com...
On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
> No, conclusion is fine. Nonsense are your attempts to equal "is" and
> "points to". And, they lead to poor coding and errors (see your own
> attempts earlier in this thread to explain your stance).
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Do you accept that the same pointer-type can point to an char or an array 
> of
> char's?

I accept that when pointer points to the first element of an array, we
commonly say that it points to an array.

But in

int a[1];
int (*p)[1] = &a;

p is an actual, in C type system sense, pointer to an array. And
because of such things, one should take mental note when saying
"pointer to an array" for a pointer pointing to array's first element.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Do you accpet that when Bjarne Stroustrup says a char* can point to a single 
char or an array of chars. He is in fact techincally correct. And he fully 
understand the C++ type system.
Do you not think its more likely that you are incorrect, if you disagree 
with him?

Also do you accept what is detailed int he C++ standards where it clarifies 
that a pointer to an array, when dereferenced , returns an (n-1) dim array?


[toc] | [prev] | [next] | [standalone]


#3705

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-14 18:02 +0100
Message-ID<JuudnTN4vcYUtTrQnZ2dnUVZ8hednZ2d@giganews.com>
In reply to#3678
On 14/04/2011 16:26, Paul wrote:
>
> "Goran" <goran.pusic@gmail.com> wrote in message
> news:149c55b8-2efb-4c39-913e-e6d204cb9676@o21g2000prh.googlegroups.com...
> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>> No, conclusion is fine. Nonsense are your attempts to equal "is" and
>> "points to". And, they lead to poor coding and errors (see your own
>> attempts earlier in this thread to explain your stance).
>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> Do you accept that the same pointer-type can point to an char or an
>> array of
>> char's?
>
> I accept that when pointer points to the first element of an array, we
> commonly say that it points to an array.
>
> But in
>
> int a[1];
> int (*p)[1] = &a;
>
> p is an actual, in C type system sense, pointer to an array. And
> because of such things, one should take mental note when saying
> "pointer to an array" for a pointer pointing to array's first element.
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>
> Do you accpet that when Bjarne Stroustrup says a char* can point to a
> single char or an array of chars. He is in fact techincally correct. And
> he fully understand the C++ type system.
> Do you not think its more likely that you are incorrect, if you disagree
> with him?
>

Stop appealing to authority.  Bjarne is being informal but obviously he 
is correct as what he is saying does not disagree with what others have 
been telling you; basically "type" in the following two phrases can 
refer to a *different* type:

1) "pointer to a type"
2) "the type of the object pointed to".

Your problem is your inability to differentiate the two phrases above. 
"pointer to" is different to "pointed to" or "points to" as "pointer to" 
partially describes the type of the pointer variable not what is being 
pointed to.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3712

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-14 19:08 +0100
Message-ID<hKGpp.11439$cx.10920@newsfe24.ams2>
In reply to#3705
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:JuudnTN4vcYUtTrQnZ2dnUVZ8hednZ2d@giganews.com...
> On 14/04/2011 16:26, Paul wrote:
>>
>> "Goran" <goran.pusic@gmail.com> wrote in message
>> news:149c55b8-2efb-4c39-913e-e6d204cb9676@o21g2000prh.googlegroups.com...
>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>> No, conclusion is fine. Nonsense are your attempts to equal "is" and
>>> "points to". And, they lead to poor coding and errors (see your own
>>> attempts earlier in this thread to explain your stance).
>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>
>>> Do you accept that the same pointer-type can point to an char or an
>>> array of
>>> char's?
>>
>> I accept that when pointer points to the first element of an array, we
>> commonly say that it points to an array.
>>
>> But in
>>
>> int a[1];
>> int (*p)[1] = &a;
>>
>> p is an actual, in C type system sense, pointer to an array. And
>> because of such things, one should take mental note when saying
>> "pointer to an array" for a pointer pointing to array's first element.
>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>
>> Do you accpet that when Bjarne Stroustrup says a char* can point to a
>> single char or an array of chars. He is in fact techincally correct. And
>> he fully understand the C++ type system.
>> Do you not think its more likely that you are incorrect, if you disagree
>> with him?
>>
>
> Stop appealing to authority.  Bjarne is being informal but obviously he is 
> correct as what he is saying does not disagree with what others have been 
> telling you; basically "type" in the following two phrases can refer to a 
> *different* type:
>
> 1) "pointer to a type"
> 2) "the type of the object pointed to".
>
> Your problem is your inability to differentiate the two phrases above. 
> "pointer to" is different to "pointed to" or "points to" as "pointer to" 
> partially describes the type of the pointer variable not what is being 
> pointed to.
>
No its quite straight forward: Bjarne says that a char* pointer can point to 
a single char or an array of chars, you say otherwise.
You say that a char* does not point to an array and only points to a single 
char. You further your wrongness by saying that a type:
char (*)[3]
is a pointer to a 1d array, when this is actually a pointer to a 2d array , 
because pointers to arrays are (n-1) dimensions of the pointed to array.

Now if Bjarne says one thing and you say it is incorrect, then who is more 
likely to be wrong?
Additionally if the C++ standards defines something and you say its 
incorrect, then who is more likely to be wrong?



[toc] | [prev] | [next] | [standalone]


#3716

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-14 19:45 +0100
Message-ID<PJidnWGNavJ53TrQnZ2dnUVZ8jOdnZ2d@giganews.com>
In reply to#3712
On 14/04/2011 19:08, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:JuudnTN4vcYUtTrQnZ2dnUVZ8hednZ2d@giganews.com...
>> On 14/04/2011 16:26, Paul wrote:
>>>
>>> "Goran" <goran.pusic@gmail.com> wrote in message
>>> news:149c55b8-2efb-4c39-913e-e6d204cb9676@o21g2000prh.googlegroups.com...
>>>
>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>> No, conclusion is fine. Nonsense are your attempts to equal "is" and
>>>> "points to". And, they lead to poor coding and errors (see your own
>>>> attempts earlier in this thread to explain your stance).
>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>
>>>>
>>>> Do you accept that the same pointer-type can point to an char or an
>>>> array of
>>>> char's?
>>>
>>> I accept that when pointer points to the first element of an array, we
>>> commonly say that it points to an array.
>>>
>>> But in
>>>
>>> int a[1];
>>> int (*p)[1] = &a;
>>>
>>> p is an actual, in C type system sense, pointer to an array. And
>>> because of such things, one should take mental note when saying
>>> "pointer to an array" for a pointer pointing to array's first element.
>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>
>>>
>>> Do you accpet that when Bjarne Stroustrup says a char* can point to a
>>> single char or an array of chars. He is in fact techincally correct. And
>>> he fully understand the C++ type system.
>>> Do you not think its more likely that you are incorrect, if you disagree
>>> with him?
>>>
>>
>> Stop appealing to authority. Bjarne is being informal but obviously he
>> is correct as what he is saying does not disagree with what others
>> have been telling you; basically "type" in the following two phrases
>> can refer to a *different* type:
>>
>> 1) "pointer to a type"
>> 2) "the type of the object pointed to".
>>
>> Your problem is your inability to differentiate the two phrases above.
>> "pointer to" is different to "pointed to" or "points to" as "pointer
>> to" partially describes the type of the pointer variable not what is
>> being pointed to.
>>
> No its quite straight forward: Bjarne says that a char* pointer can
> point to a single char or an array of chars, you say otherwise.

You obviously did not read my reply: "pointer to" is different to 
"points to".  Take the time to properly read the replies people make or 
fuck off and stop posting to this newsgroup you time waster.

> You say that a char* does not point to an array and only points to a
> single char. You further your wrongness by saying that a type:
> char (*)[3]
> is a pointer to a 1d array, when this is actually a pointer to a 2d
> array , because pointers to arrays are (n-1) dimensions of the pointed
> to array.

You are wrong again:

char a[3]; // 1d array
char(*p)[3] = &a; // pointer to a 1d array

>
> Now if Bjarne says one thing and you say it is incorrect, then who is
> more likely to be wrong?

Your appeal to authority is wrong on two counts:

1) An appeal to authority is a logical fallacy;
2) The authority you are appealing to actually does not agree with your 
claim/argument (as I have described above).

> Additionally if the C++ standards defines something and you say its
> incorrect, then who is more likely to be wrong?

Where have I have said that the C++ Standard is incorrect?  I haven't 
said any such thing so you are either lying or are confused.

People may as well be talking to a brick wall when talking to you.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3718

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-14 20:55 +0100
Message-ID<DiIpp.11445$cx.7364@newsfe24.ams2>
In reply to#3716
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:PJidnWGNavJ53TrQnZ2dnUVZ8jOdnZ2d@giganews.com...
> On 14/04/2011 19:08, Paul wrote:
>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is" and
>>>>> "points to". And, they lead to poor coding and errors (see your own
>>>>> attempts earlier in this thread to explain your stance).
>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>
>>>>>
>>>>> Do you accept that the same pointer-type can point to an char or an
>>>>> array of
>>>>> char's?
>>>>
>>>> I accept that when pointer points to the first element of an array, we
>>>> commonly say that it points to an array.
>>>>
>>>> But in
>>>>
>>>> int a[1];
>>>> int (*p)[1] = &a;
>>>>
>>>> p is an actual, in C type system sense, pointer to an array. And
>>>> because of such things, one should take mental note when saying
>>>> "pointer to an array" for a pointer pointing to array's first element.
>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>
>>>>
>>>> Do you accpet that when Bjarne Stroustrup says a char* can point to a
>>>> single char or an array of chars. He is in fact techincally correct. 
>>>> And
>>>> he fully understand the C++ type system.
>>>> Do you not think its more likely that you are incorrect, if you 
>>>> disagree
>>>> with him?
>>>>
>>>
>>> Stop appealing to authority. Bjarne is being informal but obviously he
>>> is correct as what he is saying does not disagree with what others
>>> have been telling you; basically "type" in the following two phrases
>>> can refer to a *different* type:
>>>
>>> 1) "pointer to a type"
>>> 2) "the type of the object pointed to".
>>>
>>> Your problem is your inability to differentiate the two phrases above.
>>> "pointer to" is different to "pointed to" or "points to" as "pointer
>>> to" partially describes the type of the pointer variable not what is
>>> being pointed to.
>>>
>> No its quite straight forward: Bjarne says that a char* pointer can
>> point to a single char or an array of chars, you say otherwise.
>
> You obviously did not read my reply: "pointer to" is different to "points 
> to".  Take the time to properly read the replies people make or fuck off 
> and stop posting to this newsgroup you time waster.
>
No pointer to and points to is more or less the same thing. Both terms refer 
to the pointed to object.

>> You say that a char* does not point to an array and only points to a
>> single char. You further your wrongness by saying that a type:
>> char (*)[3]
>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>> array , because pointers to arrays are (n-1) dimensions of the pointed
>> to array.
>
> You are wrong again:
>
> char a[3]; // 1d array
> char(*p)[3] = &a; // pointer to a 1d array

No you are wrong because this doesn't mean that this type of pointer cannot 
be used as a pointer to a 2d array like so:
char a[3][3];
char (*p)[3] =a;

You take the address of a thus introducing an unneccessary extra level of 
indirection.


>
>>
>> Now if Bjarne says one thing and you say it is incorrect, then who is
>> more likely to be wrong?
>
> Your appeal to authority is wrong on two counts:
>
> 1) An appeal to authority is a logical fallacy;
> 2) The authority you are appealing to actually does not agree with your 
> claim/argument (as I have described above).
The authority states that char* can point to a single char or an array of 
chars. Which is in direct agreement with me and disagrees with you.


>
>> Additionally if the C++ standards defines something and you say its
>> incorrect, then who is more likely to be wrong?
>
> Where have I have said that the C++ Standard is incorrect?  I haven't said 
> any such thing so you are either lying or are confused.
You said that char (*p)[3] points to a 1d array and not to a 2d array, but 
the standard states different.

[toc] | [prev] | [next] | [standalone]


#3719

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-14 21:10 +0100
Message-ID<bvCdnUEhg_UjyTrQnZ2dnUVZ8jWdnZ2d@giganews.com>
In reply to#3718
On 14/04/2011 20:55, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:PJidnWGNavJ53TrQnZ2dnUVZ8jOdnZ2d@giganews.com...
>> On 14/04/2011 19:08, Paul wrote:
>>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is" and
>>>>>> "points to". And, they lead to poor coding and errors (see your own
>>>>>> attempts earlier in this thread to explain your stance).
>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>
>>>>>>
>>>>>>
>>>>>> Do you accept that the same pointer-type can point to an char or an
>>>>>> array of
>>>>>> char's?
>>>>>
>>>>> I accept that when pointer points to the first element of an array, we
>>>>> commonly say that it points to an array.
>>>>>
>>>>> But in
>>>>>
>>>>> int a[1];
>>>>> int (*p)[1] = &a;
>>>>>
>>>>> p is an actual, in C type system sense, pointer to an array. And
>>>>> because of such things, one should take mental note when saying
>>>>> "pointer to an array" for a pointer pointing to array's first element.
>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>
>>>>>
>>>>>
>>>>> Do you accpet that when Bjarne Stroustrup says a char* can point to a
>>>>> single char or an array of chars. He is in fact techincally
>>>>> correct. And
>>>>> he fully understand the C++ type system.
>>>>> Do you not think its more likely that you are incorrect, if you
>>>>> disagree
>>>>> with him?
>>>>>
>>>>
>>>> Stop appealing to authority. Bjarne is being informal but obviously he
>>>> is correct as what he is saying does not disagree with what others
>>>> have been telling you; basically "type" in the following two phrases
>>>> can refer to a *different* type:
>>>>
>>>> 1) "pointer to a type"
>>>> 2) "the type of the object pointed to".
>>>>
>>>> Your problem is your inability to differentiate the two phrases above.
>>>> "pointer to" is different to "pointed to" or "points to" as "pointer
>>>> to" partially describes the type of the pointer variable not what is
>>>> being pointed to.
>>>>
>>> No its quite straight forward: Bjarne says that a char* pointer can
>>> point to a single char or an array of chars, you say otherwise.
>>
>> You obviously did not read my reply: "pointer to" is different to
>> "points to". Take the time to properly read the replies people make or
>> fuck off and stop posting to this newsgroup you time waster.
>>
> No pointer to and points to is more or less the same thing. Both terms
> refer to the pointed to object.

No they are not "more or less the same thing"; "more or less the same 
thing" is woolly language and has no place in a technical discussion; 
also see below.

>
>>> You say that a char* does not point to an array and only points to a
>>> single char. You further your wrongness by saying that a type:
>>> char (*)[3]
>>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>>> array , because pointers to arrays are (n-1) dimensions of the pointed
>>> to array.
>>
>> You are wrong again:
>>
>> char a[3]; // 1d array
>> char(*p)[3] = &a; // pointer to a 1d array
>
> No you are wrong because this doesn't mean that this type of pointer
> cannot be used as a pointer to a 2d array like so:
> char a[3][3];
> char (*p)[3] =a;

No p is still a pointer to a 1d array; your code is invoking array 
pointer decay as it is equivalent to:

char a[3][3];
char (*p)[3] =&a[0];

Your understanding of arrays and pointers is flawed.

>
> You take the address of a thus introducing an unneccessary extra level
> of indirection.

Of course; a pointer to an array is an extra level of indirection; a 
pointer to an array element isn't.

>
>
>>
>>>
>>> Now if Bjarne says one thing and you say it is incorrect, then who is
>>> more likely to be wrong?
>>
>> Your appeal to authority is wrong on two counts:
>>
>> 1) An appeal to authority is a logical fallacy;
>> 2) The authority you are appealing to actually does not agree with
>> your claim/argument (as I have described above).
> The authority states that char* can point to a single char or an array
> of chars. Which is in direct agreement with me and disagrees with you.

Again: there is a difference between "a pointer to" and "points to". 
Consider:

struct base {};
struct derived : base {};

derived o;
base* p = &o;

p is a pointer to a base even though it points to an object of derived type.

>
>
>>
>>> Additionally if the C++ standards defines something and you say its
>>> incorrect, then who is more likely to be wrong?
>>
>> Where have I have said that the C++ Standard is incorrect? I haven't
>> said any such thing so you are either lying or are confused.

> You said that char (*p)[3] points to a 1d array and not to a 2d array,
> but the standard states different.
>

p is a pointer to a 1d array and the standard does not state different; 
p may point to a 1d array subobject of a 2d array and if it is pointing 
to the first 1d array subobject of the 2d array then one can say it 
points to a 2d array but this is informal language and technically 
inaccurate.  As others have said "points into" is a more acceptable term 
that covers all bases.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3724

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-14 23:04 +0100
Message-ID<MbKpp.5495$Y71.611@newsfe17.ams2>
In reply to#3719
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:bvCdnUEhg_UjyTrQnZ2dnUVZ8jWdnZ2d@giganews.com...
> On 14/04/2011 20:55, Paul wrote:
>>>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is" and
>>>>>>> "points to". And, they lead to poor coding and errors (see your own
>>>>>>> attempts earlier in this thread to explain your stance).
>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Do you accept that the same pointer-type can point to an char or an
>>>>>>> array of
>>>>>>> char's?
>>>>>>
>>>>>> I accept that when pointer points to the first element of an array, 
>>>>>> we
>>>>>> commonly say that it points to an array.
>>>>>>
>>>>>> But in
>>>>>>
>>>>>> int a[1];
>>>>>> int (*p)[1] = &a;
>>>>>>
>>>>>> p is an actual, in C type system sense, pointer to an array. And
>>>>>> because of such things, one should take mental note when saying
>>>>>> "pointer to an array" for a pointer pointing to array's first 
>>>>>> element.
>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>
>>>>>>
>>>>>>
>>>>>> Do you accpet that when Bjarne Stroustrup says a char* can point to a
>>>>>> single char or an array of chars. He is in fact techincally
>>>>>> correct. And
>>>>>> he fully understand the C++ type system.
>>>>>> Do you not think its more likely that you are incorrect, if you
>>>>>> disagree
>>>>>> with him?
>>>>>>
>>>>>
>>>>> Stop appealing to authority. Bjarne is being informal but obviously he
>>>>> is correct as what he is saying does not disagree with what others
>>>>> have been telling you; basically "type" in the following two phrases
>>>>> can refer to a *different* type:
>>>>>
>>>>> 1) "pointer to a type"
>>>>> 2) "the type of the object pointed to".
>>>>>
>>>>> Your problem is your inability to differentiate the two phrases above.
>>>>> "pointer to" is different to "pointed to" or "points to" as "pointer
>>>>> to" partially describes the type of the pointer variable not what is
>>>>> being pointed to.
>>>>>
>>>> No its quite straight forward: Bjarne says that a char* pointer can
>>>> point to a single char or an array of chars, you say otherwise.
>>>
>>> You obviously did not read my reply: "pointer to" is different to
>>> "points to". Take the time to properly read the replies people make or
>>> fuck off and stop posting to this newsgroup you time waster.
>>>
>> No pointer to and points to is more or less the same thing. Both terms
>> refer to the pointed to object.
>
> No they are not "more or less the same thing"; "more or less the same 
> thing" is woolly language and has no place in a technical discussion; also 
> see below.
>
>>
>>>> You say that a char* does not point to an array and only points to a
>>>> single char. You further your wrongness by saying that a type:
>>>> char (*)[3]
>>>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>>>> array , because pointers to arrays are (n-1) dimensions of the pointed
>>>> to array.
>>>
>>> You are wrong again:
>>>
>>> char a[3]; // 1d array
>>> char(*p)[3] = &a; // pointer to a 1d array
>>
>> No you are wrong because this doesn't mean that this type of pointer
>> cannot be used as a pointer to a 2d array like so:
>> char a[3][3];
>> char (*p)[3] =a;
>
> No p is still a pointer to a 1d array; your code is invoking array pointer 
> decay as it is equivalent to:
>
> char a[3][3];
> char (*p)[3] =&a[0];
>
> Your understanding of arrays and pointers is flawed.

Your understanding is flawed, the C++ standard defines a pointer to a 2d 
array to be of this type/ level of indirection.

>
>>
>> You take the address of a thus introducing an unneccessary extra level
>> of indirection.
>
> Of course; a pointer to an array is an extra level of indirection; a 
> pointer to an array element isn't.
>
No. According to the C++ standards, a pointer to an array is a different 
level of indirection, but in the opposite direction from what you are 
saying.

>>
>>
>>>
>>>>
>>>> Now if Bjarne says one thing and you say it is incorrect, then who is
>>>> more likely to be wrong?
>>>
>>> Your appeal to authority is wrong on two counts:
>>>
>>> 1) An appeal to authority is a logical fallacy;
>>> 2) The authority you are appealing to actually does not agree with
>>> your claim/argument (as I have described above).
>> The authority states that char* can point to a single char or an array
>> of chars. Which is in direct agreement with me and disagrees with you.
>
> Again: there is a difference between "a pointer to" and "points to". 
> Consider:
>
> struct base {};
> struct derived : base {};
>
> derived o;
> base* p = &o;
>
> p is a pointer to a base even though it points to an object of derived 
> type.
>
Its a pointer to what it points to , its the same thing.

You are confused by the pointer-type and what it points to.

>>
>>
>>>
>>>> Additionally if the C++ standards defines something and you say its
>>>> incorrect, then who is more likely to be wrong?
>>>
>>> Where have I have said that the C++ Standard is incorrect? I haven't
>>> said any such thing so you are either lying or are confused.
>
>> You said that char (*p)[3] points to a 1d array and not to a 2d array,
>> but the standard states different.
>>
>
> p is a pointer to a 1d array and the standard does not state different; p 
> may point to a 1d array subobject of a 2d array and if it is pointing to 
> the first 1d array subobject of the 2d array then one can say it points to 
> a 2d array but this is informal language and technically inaccurate.  As 
> others have said "points into" is a more acceptable term that covers all 
> bases.
>
This is utter nonsesne the C++ standard states clearly what a pointer to an 
array is and how it behaves.
A pointer to a 2d array, when derefernced returns a 1d array subobject. And 
that is a FACT defined in the C++ Standard.
It doesn't matter how much you try to worm your way around this fact, it is 
clearly defined in the standards and until you accept this fact you will 
always be wrong.


[toc] | [prev] | [next] | [standalone]


#3725

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-14 23:24 +0100
Message-ID<W56dnSAUH4Su6TrQnZ2dnUVZ8iCdnZ2d@giganews.com>
In reply to#3724
On 14/04/2011 23:04, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:bvCdnUEhg_UjyTrQnZ2dnUVZ8jWdnZ2d@giganews.com...
>> On 14/04/2011 20:55, Paul wrote:
>>>>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is"
>>>>>>>> and
>>>>>>>> "points to". And, they lead to poor coding and errors (see your own
>>>>>>>> attempts earlier in this thread to explain your stance).
>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Do you accept that the same pointer-type can point to an char or an
>>>>>>>> array of
>>>>>>>> char's?
>>>>>>>
>>>>>>> I accept that when pointer points to the first element of an
>>>>>>> array, we
>>>>>>> commonly say that it points to an array.
>>>>>>>
>>>>>>> But in
>>>>>>>
>>>>>>> int a[1];
>>>>>>> int (*p)[1] = &a;
>>>>>>>
>>>>>>> p is an actual, in C type system sense, pointer to an array. And
>>>>>>> because of such things, one should take mental note when saying
>>>>>>> "pointer to an array" for a pointer pointing to array's first
>>>>>>> element.
>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Do you accpet that when Bjarne Stroustrup says a char* can point
>>>>>>> to a
>>>>>>> single char or an array of chars. He is in fact techincally
>>>>>>> correct. And
>>>>>>> he fully understand the C++ type system.
>>>>>>> Do you not think its more likely that you are incorrect, if you
>>>>>>> disagree
>>>>>>> with him?
>>>>>>>
>>>>>>
>>>>>> Stop appealing to authority. Bjarne is being informal but
>>>>>> obviously he
>>>>>> is correct as what he is saying does not disagree with what others
>>>>>> have been telling you; basically "type" in the following two phrases
>>>>>> can refer to a *different* type:
>>>>>>
>>>>>> 1) "pointer to a type"
>>>>>> 2) "the type of the object pointed to".
>>>>>>
>>>>>> Your problem is your inability to differentiate the two phrases
>>>>>> above.
>>>>>> "pointer to" is different to "pointed to" or "points to" as "pointer
>>>>>> to" partially describes the type of the pointer variable not what is
>>>>>> being pointed to.
>>>>>>
>>>>> No its quite straight forward: Bjarne says that a char* pointer can
>>>>> point to a single char or an array of chars, you say otherwise.
>>>>
>>>> You obviously did not read my reply: "pointer to" is different to
>>>> "points to". Take the time to properly read the replies people make or
>>>> fuck off and stop posting to this newsgroup you time waster.
>>>>
>>> No pointer to and points to is more or less the same thing. Both terms
>>> refer to the pointed to object.
>>
>> No they are not "more or less the same thing"; "more or less the same
>> thing" is woolly language and has no place in a technical discussion;
>> also see below.
>>
>>>
>>>>> You say that a char* does not point to an array and only points to a
>>>>> single char. You further your wrongness by saying that a type:
>>>>> char (*)[3]
>>>>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>>>>> array , because pointers to arrays are (n-1) dimensions of the pointed
>>>>> to array.
>>>>
>>>> You are wrong again:
>>>>
>>>> char a[3]; // 1d array
>>>> char(*p)[3] = &a; // pointer to a 1d array
>>>
>>> No you are wrong because this doesn't mean that this type of pointer
>>> cannot be used as a pointer to a 2d array like so:
>>> char a[3][3];
>>> char (*p)[3] =a;
>>
>> No p is still a pointer to a 1d array; your code is invoking array
>> pointer decay as it is equivalent to:
>>
>> char a[3][3];
>> char (*p)[3] =&a[0];
>>
>> Your understanding of arrays and pointers is flawed.
>
> Your understanding is flawed, the C++ standard defines a pointer to a 2d
> array to be of this type/ level of indirection.

Your understanding is flawed:

char(*)[N] is a pointer to a 1d array
char(*)[N1][N2] is a pointer to a 2d array

>
>>
>>>
>>> You take the address of a thus introducing an unneccessary extra level
>>> of indirection.
>>
>> Of course; a pointer to an array is an extra level of indirection; a
>> pointer to an array element isn't.
>>
> No. According to the C++ standards, a pointer to an array is a different
> level of indirection, but in the opposite direction from what you are
> saying.

That was just gibberish.

>
>>>
>>>
>>>>
>>>>>
>>>>> Now if Bjarne says one thing and you say it is incorrect, then who is
>>>>> more likely to be wrong?
>>>>
>>>> Your appeal to authority is wrong on two counts:
>>>>
>>>> 1) An appeal to authority is a logical fallacy;
>>>> 2) The authority you are appealing to actually does not agree with
>>>> your claim/argument (as I have described above).
>>> The authority states that char* can point to a single char or an array
>>> of chars. Which is in direct agreement with me and disagrees with you.
>>
>> Again: there is a difference between "a pointer to" and "points to".
>> Consider:
>>
>> struct base {};
>> struct derived : base {};
>>
>> derived o;
>> base* p = &o;
>>
>> p is a pointer to a base even though it points to an object of derived
>> type.
>>
> Its a pointer to what it points to , its the same thing.

No it isn't.  A pointer has a type; a pointer's type does not have to be 
the same type as the object it points to.

>
> You are confused by the pointer-type and what it points to.

It is obvious to all that it is you who has been confused; is currently 
confused and probably will continue to be confused as you refuse to 
learn from others.

>
>>>
>>>
>>>>
>>>>> Additionally if the C++ standards defines something and you say its
>>>>> incorrect, then who is more likely to be wrong?
>>>>
>>>> Where have I have said that the C++ Standard is incorrect? I haven't
>>>> said any such thing so you are either lying or are confused.
>>
>>> You said that char (*p)[3] points to a 1d array and not to a 2d array,
>>> but the standard states different.
>>>
>>
>> p is a pointer to a 1d array and the standard does not state
>> different; p may point to a 1d array subobject of a 2d array and if it
>> is pointing to the first 1d array subobject of the 2d array then one
>> can say it points to a 2d array but this is informal language and
>> technically inaccurate. As others have said "points into" is a more
>> acceptable term that covers all bases.
>>
> This is utter nonsesne the C++ standard states clearly what a pointer to
> an array is and how it behaves.
> A pointer to a 2d array, when derefernced returns a 1d array subobject.
> And that is a FACT defined in the C++ Standard.
> It doesn't matter how much you try to worm your way around this fact, it
> is clearly defined in the standards and until you accept this fact you
> will always be wrong.

You are the one spouting utter nonsense; the Standard says no such 
thing.  Dereferencing a pointer to a 2d array results in a reference to 
a 2d array as the following code shows:

template <typename T, std::size_t N1, std::size_t N2>
void is_a_2d_array(T (&a)[N1][N2])
{
	std::cout << "2D array; dimensions = " << N1 << " x " << N2;
}

int main()
{
	char a[7][42]; // 2D array
	char (*p)[7][42] =&a; // pointer to a 2D array
	is_a_2d_array(*p); // dereferenced pointer to a 2D array is a 2D array 
reference
}

/Leigh

[toc] | [prev] | [next] | [standalone]


#3727

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-14 23:31 +0100
Message-ID<JsmdnWsOobtZ6DrQnZ2dnUVZ8sudnZ2d@giganews.com>
In reply to#3725
On 14/04/2011 23:24, Leigh Johnston wrote:
> On 14/04/2011 23:04, Paul wrote:
[...]
>> This is utter nonsesne the C++ standard states clearly what a pointer to
>> an array is and how it behaves.
>> A pointer to a 2d array, when derefernced returns a 1d array subobject.
>> And that is a FACT defined in the C++ Standard.
>> It doesn't matter how much you try to worm your way around this fact, it
>> is clearly defined in the standards and until you accept this fact you
>> will always be wrong.
>
> You are the one spouting utter nonsense; the Standard says no such
> thing. Dereferencing a pointer to a 2d array results in a reference to a
> 2d array as the following code shows:
>
> template <typename T, std::size_t N1, std::size_t N2>
> void is_a_2d_array(T (&a)[N1][N2])
> {
> std::cout << "2D array; dimensions = " << N1 << " x " << N2;
> }
>
> int main()
> {
> char a[7][42]; // 2D array
> char (*p)[7][42] =&a; // pointer to a 2D array
> is_a_2d_array(*p); // dereferenced pointer to a 2D array is a 2D array
> reference
> }
>

And just to be clear "is_a_2d_array" could be renamed to 
"an_array_with_at_least_two_dimensions" as you can pass it an array with 
more than 2 dimensions but you *cannot* pass it an array with just 1 
dimension.  The fact that the above code compiles is proof that your 
claim that dereferencing a pointer to a 2d array returns a 1d array.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3728

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-14 23:33 +0100
Message-ID<JsmdnWoOobut6zrQnZ2dnUVZ8sudnZ2d@giganews.com>
In reply to#3727
On 14/04/2011 23:31, Leigh Johnston wrote:
> On 14/04/2011 23:24, Leigh Johnston wrote:
>> On 14/04/2011 23:04, Paul wrote:
> [...]
>>> This is utter nonsesne the C++ standard states clearly what a pointer to
>>> an array is and how it behaves.
>>> A pointer to a 2d array, when derefernced returns a 1d array subobject.
>>> And that is a FACT defined in the C++ Standard.
>>> It doesn't matter how much you try to worm your way around this fact, it
>>> is clearly defined in the standards and until you accept this fact you
>>> will always be wrong.
>>
>> You are the one spouting utter nonsense; the Standard says no such
>> thing. Dereferencing a pointer to a 2d array results in a reference to a
>> 2d array as the following code shows:
>>
>> template <typename T, std::size_t N1, std::size_t N2>
>> void is_a_2d_array(T (&a)[N1][N2])
>> {
>> std::cout << "2D array; dimensions = " << N1 << " x " << N2;
>> }
>>
>> int main()
>> {
>> char a[7][42]; // 2D array
>> char (*p)[7][42] =&a; // pointer to a 2D array
>> is_a_2d_array(*p); // dereferenced pointer to a 2D array is a 2D array
>> reference
>> }
>>
>
> And just to be clear "is_a_2d_array" could be renamed to
> "an_array_with_at_least_two_dimensions" as you can pass it an array with
> more than 2 dimensions but you *cannot* pass it an array with just 1
> dimension. The fact that the above code compiles is proof that your
> claim that dereferencing a pointer to a 2d array returns a 1d array.

.. is invalid

/Leigh

[toc] | [prev] | [next] | [standalone]


#3732

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-15 01:28 +0100
Message-ID<gjMpp.21216$2W5.3827@newsfe16.ams2>
In reply to#3725
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:W56dnSAUH4Su6TrQnZ2dnUVZ8iCdnZ2d@giganews.com...
>>>>>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is"
>>>>>>>>> and
>>>>>>>>> "points to". And, they lead to poor coding and errors (see your 
>>>>>>>>> own
>>>>>>>>> attempts earlier in this thread to explain your stance).
>>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Do you accept that the same pointer-type can point to an char or 
>>>>>>>>> an
>>>>>>>>> array of
>>>>>>>>> char's?
>>>>>>>>
>>>>>>>> I accept that when pointer points to the first element of an
>>>>>>>> array, we
>>>>>>>> commonly say that it points to an array.
>>>>>>>>
>>>>>>>> But in
>>>>>>>>
>>>>>>>> int a[1];
>>>>>>>> int (*p)[1] = &a;
>>>>>>>>
>>>>>>>> p is an actual, in C type system sense, pointer to an array. And
>>>>>>>> because of such things, one should take mental note when saying
>>>>>>>> "pointer to an array" for a pointer pointing to array's first
>>>>>>>> element.
>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Do you accpet that when Bjarne Stroustrup says a char* can point
>>>>>>>> to a
>>>>>>>> single char or an array of chars. He is in fact techincally
>>>>>>>> correct. And
>>>>>>>> he fully understand the C++ type system.
>>>>>>>> Do you not think its more likely that you are incorrect, if you
>>>>>>>> disagree
>>>>>>>> with him?
>>>>>>>>
>>>>>>>
>>>>>>> Stop appealing to authority. Bjarne is being informal but
>>>>>>> obviously he
>>>>>>> is correct as what he is saying does not disagree with what others
>>>>>>> have been telling you; basically "type" in the following two phrases
>>>>>>> can refer to a *different* type:
>>>>>>>
>>>>>>> 1) "pointer to a type"
>>>>>>> 2) "the type of the object pointed to".
>>>>>>>
>>>>>>> Your problem is your inability to differentiate the two phrases
>>>>>>> above.
>>>>>>> "pointer to" is different to "pointed to" or "points to" as "pointer
>>>>>>> to" partially describes the type of the pointer variable not what is
>>>>>>> being pointed to.
>>>>>>>
>>>>>> No its quite straight forward: Bjarne says that a char* pointer can
>>>>>> point to a single char or an array of chars, you say otherwise.
>>>>>
>>>>> You obviously did not read my reply: "pointer to" is different to
>>>>> "points to". Take the time to properly read the replies people make or
>>>>> fuck off and stop posting to this newsgroup you time waster.
>>>>>
>>>> No pointer to and points to is more or less the same thing. Both terms
>>>> refer to the pointed to object.
>>>
>>> No they are not "more or less the same thing"; "more or less the same
>>> thing" is woolly language and has no place in a technical discussion;
>>> also see below.
>>>
>>>>
>>>>>> You say that a char* does not point to an array and only points to a
>>>>>> single char. You further your wrongness by saying that a type:
>>>>>> char (*)[3]
>>>>>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>>>>>> array , because pointers to arrays are (n-1) dimensions of the 
>>>>>> pointed
>>>>>> to array.
>>>>>
>>>>> You are wrong again:
>>>>>
>>>>> char a[3]; // 1d array
>>>>> char(*p)[3] = &a; // pointer to a 1d array
>>>>
>>>> No you are wrong because this doesn't mean that this type of pointer
>>>> cannot be used as a pointer to a 2d array like so:
>>>> char a[3][3];
>>>> char (*p)[3] =a;
>>>
>>> No p is still a pointer to a 1d array; your code is invoking array
>>> pointer decay as it is equivalent to:
>>>
>>> char a[3][3];
>>> char (*p)[3] =&a[0];
>>>
>>> Your understanding of arrays and pointers is flawed.
>>
>> Your understanding is flawed, the C++ standard defines a pointer to a 2d
>> array to be of this type/ level of indirection.
>
> Your understanding is flawed:
>
> char(*)[N] is a pointer to a 1d array
> char(*)[N1][N2] is a pointer to a 2d array
>
No this is the pointer TYPE.
When a 1d array of chars is converted to a pointer the pointer-type is char* 
, not char (*)[somesize].

Its all explained in the standards.

>>
>>>
>>>>
>>>> You take the address of a thus introducing an unneccessary extra level
>>>> of indirection.
>>>
>>> Of course; a pointer to an array is an extra level of indirection; a
>>> pointer to an array element isn't.
>>>
>> No. According to the C++ standards, a pointer to an array is a different
>> level of indirection, but in the opposite direction from what you are
>> saying.
>
> That was just gibberish.
>
>>
>>>>
>>>>
>>>>>
>>>>>>
>>>>>> Now if Bjarne says one thing and you say it is incorrect, then who is
>>>>>> more likely to be wrong?
>>>>>
>>>>> Your appeal to authority is wrong on two counts:
>>>>>
>>>>> 1) An appeal to authority is a logical fallacy;
>>>>> 2) The authority you are appealing to actually does not agree with
>>>>> your claim/argument (as I have described above).
>>>> The authority states that char* can point to a single char or an array
>>>> of chars. Which is in direct agreement with me and disagrees with you.
>>>
>>> Again: there is a difference between "a pointer to" and "points to".
>>> Consider:
>>>
>>> struct base {};
>>> struct derived : base {};
>>>
>>> derived o;
>>> base* p = &o;
>>>
>>> p is a pointer to a base even though it points to an object of derived
>>> type.
>>>
>> Its a pointer to what it points to , its the same thing.
>
> No it isn't.  A pointer has a type; a pointer's type does not have to be 
> the same type as the object it points to.

This is where you fail , because you have on many occassions said that a 
pointer to T, can only point to a T.

As you say a char* can only point to a single char and cannot point to an 
array of chars.
But when I post quotations from Stroustrup and the C Faqs , you start to 
look stupid.

You are inconsistent and seem confused.
>
>>
>> You are confused by the pointer-type and what it points to.
>
> It is obvious to all that it is you who has been confused; is currently 
> confused and probably will continue to be confused as you refuse to learn 
> from others.
>
>>
>>>>
>>>>
>>>>>
>>>>>> Additionally if the C++ standards defines something and you say its
>>>>>> incorrect, then who is more likely to be wrong?
>>>>>
>>>>> Where have I have said that the C++ Standard is incorrect? I haven't
>>>>> said any such thing so you are either lying or are confused.
>>>
>>>> You said that char (*p)[3] points to a 1d array and not to a 2d array,
>>>> but the standard states different.
>>>>
>>>
>>> p is a pointer to a 1d array and the standard does not state
>>> different; p may point to a 1d array subobject of a 2d array and if it
>>> is pointing to the first 1d array subobject of the 2d array then one
>>> can say it points to a 2d array but this is informal language and
>>> technically inaccurate. As others have said "points into" is a more
>>> acceptable term that covers all bases.
>>>
>> This is utter nonsesne the C++ standard states clearly what a pointer to
>> an array is and how it behaves.
>> A pointer to a 2d array, when derefernced returns a 1d array subobject.
>> And that is a FACT defined in the C++ Standard.
>> It doesn't matter how much you try to worm your way around this fact, it
>> is clearly defined in the standards and until you accept this fact you
>> will always be wrong.
>
> You are the one spouting utter nonsense; the Standard says no such thing. 
> Dereferencing a pointer to a 2d array results in a reference to a 2d array 
> as the following code shows:
>
> template <typename T, std::size_t N1, std::size_t N2>
> void is_a_2d_array(T (&a)[N1][N2])
> {
> std::cout << "2D array; dimensions = " << N1 << " x " << N2;
> }
>
> int main()
> {
> char a[7][42]; // 2D array
> char (*p)[7][42] =&a; // pointer to a 2D array
> is_a_2d_array(*p); // dereferenced pointer to a 2D array is a 2D array 
> reference
> }
According to the C++ standards when a 2d array is converted to a pointer the 
pointer-type is a (n-1) dim array. Thus the correct conversion for a 2d 
array to a pointer is:
char a[7][7];
char (*pa)[7] = a;
The C++ standard explains this is how a 2d array is converted to a pointer, 
so that when dereferenced it returns a 1d array(one of its subarrays).

What you have done is not a standard array-pointer conversion. You have 
created an extra level of indirection.



[toc] | [prev] | [next] | [standalone]


#3747

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-15 13:31 +0100
Message-ID<osKdnQeSQp05pzXQnZ2dnUVZ7vadnZ2d@giganews.com>
In reply to#3732
On 15/04/2011 01:28, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:W56dnSAUH4Su6TrQnZ2dnUVZ8iCdnZ2d@giganews.com...
>>>>>>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>>>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is"
>>>>>>>>>> and
>>>>>>>>>> "points to". And, they lead to poor coding and errors (see
>>>>>>>>>> your own
>>>>>>>>>> attempts earlier in this thread to explain your stance).
>>>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Do you accept that the same pointer-type can point to an char
>>>>>>>>>> or an
>>>>>>>>>> array of
>>>>>>>>>> char's?
>>>>>>>>>
>>>>>>>>> I accept that when pointer points to the first element of an
>>>>>>>>> array, we
>>>>>>>>> commonly say that it points to an array.
>>>>>>>>>
>>>>>>>>> But in
>>>>>>>>>
>>>>>>>>> int a[1];
>>>>>>>>> int (*p)[1] = &a;
>>>>>>>>>
>>>>>>>>> p is an actual, in C type system sense, pointer to an array. And
>>>>>>>>> because of such things, one should take mental note when saying
>>>>>>>>> "pointer to an array" for a pointer pointing to array's first
>>>>>>>>> element.
>>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Do you accpet that when Bjarne Stroustrup says a char* can point
>>>>>>>>> to a
>>>>>>>>> single char or an array of chars. He is in fact techincally
>>>>>>>>> correct. And
>>>>>>>>> he fully understand the C++ type system.
>>>>>>>>> Do you not think its more likely that you are incorrect, if you
>>>>>>>>> disagree
>>>>>>>>> with him?
>>>>>>>>>
>>>>>>>>
>>>>>>>> Stop appealing to authority. Bjarne is being informal but
>>>>>>>> obviously he
>>>>>>>> is correct as what he is saying does not disagree with what others
>>>>>>>> have been telling you; basically "type" in the following two
>>>>>>>> phrases
>>>>>>>> can refer to a *different* type:
>>>>>>>>
>>>>>>>> 1) "pointer to a type"
>>>>>>>> 2) "the type of the object pointed to".
>>>>>>>>
>>>>>>>> Your problem is your inability to differentiate the two phrases
>>>>>>>> above.
>>>>>>>> "pointer to" is different to "pointed to" or "points to" as
>>>>>>>> "pointer
>>>>>>>> to" partially describes the type of the pointer variable not
>>>>>>>> what is
>>>>>>>> being pointed to.
>>>>>>>>
>>>>>>> No its quite straight forward: Bjarne says that a char* pointer can
>>>>>>> point to a single char or an array of chars, you say otherwise.
>>>>>>
>>>>>> You obviously did not read my reply: "pointer to" is different to
>>>>>> "points to". Take the time to properly read the replies people
>>>>>> make or
>>>>>> fuck off and stop posting to this newsgroup you time waster.
>>>>>>
>>>>> No pointer to and points to is more or less the same thing. Both terms
>>>>> refer to the pointed to object.
>>>>
>>>> No they are not "more or less the same thing"; "more or less the same
>>>> thing" is woolly language and has no place in a technical discussion;
>>>> also see below.
>>>>
>>>>>
>>>>>>> You say that a char* does not point to an array and only points to a
>>>>>>> single char. You further your wrongness by saying that a type:
>>>>>>> char (*)[3]
>>>>>>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>>>>>>> array , because pointers to arrays are (n-1) dimensions of the
>>>>>>> pointed
>>>>>>> to array.
>>>>>>
>>>>>> You are wrong again:
>>>>>>
>>>>>> char a[3]; // 1d array
>>>>>> char(*p)[3] = &a; // pointer to a 1d array
>>>>>
>>>>> No you are wrong because this doesn't mean that this type of pointer
>>>>> cannot be used as a pointer to a 2d array like so:
>>>>> char a[3][3];
>>>>> char (*p)[3] =a;
>>>>
>>>> No p is still a pointer to a 1d array; your code is invoking array
>>>> pointer decay as it is equivalent to:
>>>>
>>>> char a[3][3];
>>>> char (*p)[3] =&a[0];
>>>>
>>>> Your understanding of arrays and pointers is flawed.
>>>
>>> Your understanding is flawed, the C++ standard defines a pointer to a 2d
>>> array to be of this type/ level of indirection.
>>
>> Your understanding is flawed:
>>
>> char(*)[N] is a pointer to a 1d array
>> char(*)[N1][N2] is a pointer to a 2d array
>>
> No this is the pointer TYPE.
> When a 1d array of chars is converted to a pointer the pointer-type is
> char* , not char (*)[somesize].
>
> Its all explained in the standards.
>
>>>
>>>>
>>>>>
>>>>> You take the address of a thus introducing an unneccessary extra level
>>>>> of indirection.
>>>>
>>>> Of course; a pointer to an array is an extra level of indirection; a
>>>> pointer to an array element isn't.
>>>>
>>> No. According to the C++ standards, a pointer to an array is a different
>>> level of indirection, but in the opposite direction from what you are
>>> saying.
>>
>> That was just gibberish.
>>
>>>
>>>>>
>>>>>
>>>>>>
>>>>>>>
>>>>>>> Now if Bjarne says one thing and you say it is incorrect, then
>>>>>>> who is
>>>>>>> more likely to be wrong?
>>>>>>
>>>>>> Your appeal to authority is wrong on two counts:
>>>>>>
>>>>>> 1) An appeal to authority is a logical fallacy;
>>>>>> 2) The authority you are appealing to actually does not agree with
>>>>>> your claim/argument (as I have described above).
>>>>> The authority states that char* can point to a single char or an array
>>>>> of chars. Which is in direct agreement with me and disagrees with you.
>>>>
>>>> Again: there is a difference between "a pointer to" and "points to".
>>>> Consider:
>>>>
>>>> struct base {};
>>>> struct derived : base {};
>>>>
>>>> derived o;
>>>> base* p = &o;
>>>>
>>>> p is a pointer to a base even though it points to an object of derived
>>>> type.
>>>>
>>> Its a pointer to what it points to , its the same thing.
>>
>> No it isn't. A pointer has a type; a pointer's type does not have to
>> be the same type as the object it points to.
>
> This is where you fail , because you have on many occassions said that a
> pointer to T, can only point to a T.

No I haven't; I have said that a pointer to a scalar is not a pointer to 
an array and have said that "pointer to" is different to "points to" if, 
like you, we disregard technical accuracy.

>
> As you say a char* can only point to a single char and cannot point to
> an array of chars.
> But when I post quotations from Stroustrup and the C Faqs , you start to
> look stupid.

I have said that a pointer to a scalar is not a pointer to an array; a 
pointer to a scalar can point to an array element of the same scalar type.

>
> You are inconsistent and seem confused.

I am not inconsistent; you are both confused and cause confusion due to 
your use of ambiguous terminology and lack of technical accuracy.

>>
>>>
>>> You are confused by the pointer-type and what it points to.
>>
>> It is obvious to all that it is you who has been confused; is
>> currently confused and probably will continue to be confused as you
>> refuse to learn from others.
>>
>>>
>>>>>
>>>>>
>>>>>>
>>>>>>> Additionally if the C++ standards defines something and you say its
>>>>>>> incorrect, then who is more likely to be wrong?
>>>>>>
>>>>>> Where have I have said that the C++ Standard is incorrect? I haven't
>>>>>> said any such thing so you are either lying or are confused.
>>>>
>>>>> You said that char (*p)[3] points to a 1d array and not to a 2d array,
>>>>> but the standard states different.
>>>>>
>>>>
>>>> p is a pointer to a 1d array and the standard does not state
>>>> different; p may point to a 1d array subobject of a 2d array and if it
>>>> is pointing to the first 1d array subobject of the 2d array then one
>>>> can say it points to a 2d array but this is informal language and
>>>> technically inaccurate. As others have said "points into" is a more
>>>> acceptable term that covers all bases.
>>>>
>>> This is utter nonsesne the C++ standard states clearly what a pointer to
>>> an array is and how it behaves.
>>> A pointer to a 2d array, when derefernced returns a 1d array subobject.
>>> And that is a FACT defined in the C++ Standard.
>>> It doesn't matter how much you try to worm your way around this fact, it
>>> is clearly defined in the standards and until you accept this fact you
>>> will always be wrong.
>>
>> You are the one spouting utter nonsense; the Standard says no such
>> thing. Dereferencing a pointer to a 2d array results in a reference to
>> a 2d array as the following code shows:
>>
>> template <typename T, std::size_t N1, std::size_t N2>
>> void is_a_2d_array(T (&a)[N1][N2])
>> {
>> std::cout << "2D array; dimensions = " << N1 << " x " << N2;
>> }
>>
>> int main()
>> {
>> char a[7][42]; // 2D array
>> char (*p)[7][42] =&a; // pointer to a 2D array
>> is_a_2d_array(*p); // dereferenced pointer to a 2D array is a 2D array
>> reference
>> }
> According to the C++ standards when a 2d array is converted to a pointer
> the pointer-type is a (n-1) dim array. Thus the correct conversion for a
> 2d array to a pointer is:
> char a[7][7];
> char (*pa)[7] = a;

pa above is *not* a pointer to a 2D array; it is a pointer to a 1D array.

> The C++ standard explains this is how a 2d array is converted to a
> pointer, so that when dereferenced it returns a 1d array(one of its
> subarrays).

Indeed; this is implicit array-to-pointer conversion; nobody has said 
that this is incorrect.

>
> What you have done is not a standard array-pointer conversion. You have
> created an extra level of indirection.

Correct I have created an extra level of indirection to create a pointer 
to a 2D array; without that extra level of indirection I would be 
creating a pointer to a 1D array via implicit array-to-pointer conversion.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3750

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-15 14:24 +0100
Message-ID<uGXpp.8579$bI3.4430@newsfe15.ams2>
In reply to#3747
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:osKdnQeSQp05pzXQnZ2dnUVZ7vadnZ2d@giganews.com...
> On 15/04/2011 01:28, Paul wrote:
>>>>>>>>>> On Apr 14, 2:50 pm, "Paul" <pchris...@yahoo.co.uk> wrote:
>>>>>>>>>>> No, conclusion is fine. Nonsense are your attempts to equal "is"
>>>>>>>>>>> and
>>>>>>>>>>> "points to". And, they lead to poor coding and errors (see
>>>>>>>>>>> your own
>>>>>>>>>>> attempts earlier in this thread to explain your stance).
>>>>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Do you accept that the same pointer-type can point to an char
>>>>>>>>>>> or an
>>>>>>>>>>> array of
>>>>>>>>>>> char's?
>>>>>>>>>>
>>>>>>>>>> I accept that when pointer points to the first element of an
>>>>>>>>>> array, we
>>>>>>>>>> commonly say that it points to an array.
>>>>>>>>>>
>>>>>>>>>> But in
>>>>>>>>>>
>>>>>>>>>> int a[1];
>>>>>>>>>> int (*p)[1] = &a;
>>>>>>>>>>
>>>>>>>>>> p is an actual, in C type system sense, pointer to an array. And
>>>>>>>>>> because of such things, one should take mental note when saying
>>>>>>>>>> "pointer to an array" for a pointer pointing to array's first
>>>>>>>>>> element.
>>>>>>>>>> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Do you accpet that when Bjarne Stroustrup says a char* can point
>>>>>>>>>> to a
>>>>>>>>>> single char or an array of chars. He is in fact techincally
>>>>>>>>>> correct. And
>>>>>>>>>> he fully understand the C++ type system.
>>>>>>>>>> Do you not think its more likely that you are incorrect, if you
>>>>>>>>>> disagree
>>>>>>>>>> with him?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Stop appealing to authority. Bjarne is being informal but
>>>>>>>>> obviously he
>>>>>>>>> is correct as what he is saying does not disagree with what others
>>>>>>>>> have been telling you; basically "type" in the following two
>>>>>>>>> phrases
>>>>>>>>> can refer to a *different* type:
>>>>>>>>>
>>>>>>>>> 1) "pointer to a type"
>>>>>>>>> 2) "the type of the object pointed to".
>>>>>>>>>
>>>>>>>>> Your problem is your inability to differentiate the two phrases
>>>>>>>>> above.
>>>>>>>>> "pointer to" is different to "pointed to" or "points to" as
>>>>>>>>> "pointer
>>>>>>>>> to" partially describes the type of the pointer variable not
>>>>>>>>> what is
>>>>>>>>> being pointed to.
>>>>>>>>>
>>>>>>>> No its quite straight forward: Bjarne says that a char* pointer can
>>>>>>>> point to a single char or an array of chars, you say otherwise.
>>>>>>>
>>>>>>> You obviously did not read my reply: "pointer to" is different to
>>>>>>> "points to". Take the time to properly read the replies people
>>>>>>> make or
>>>>>>> fuck off and stop posting to this newsgroup you time waster.
>>>>>>>
>>>>>> No pointer to and points to is more or less the same thing. Both 
>>>>>> terms
>>>>>> refer to the pointed to object.
>>>>>
>>>>> No they are not "more or less the same thing"; "more or less the same
>>>>> thing" is woolly language and has no place in a technical discussion;
>>>>> also see below.
>>>>>
>>>>>>
>>>>>>>> You say that a char* does not point to an array and only points to 
>>>>>>>> a
>>>>>>>> single char. You further your wrongness by saying that a type:
>>>>>>>> char (*)[3]
>>>>>>>> is a pointer to a 1d array, when this is actually a pointer to a 2d
>>>>>>>> array , because pointers to arrays are (n-1) dimensions of the
>>>>>>>> pointed
>>>>>>>> to array.
>>>>>>>
>>>>>>> You are wrong again:
>>>>>>>
>>>>>>> char a[3]; // 1d array
>>>>>>> char(*p)[3] = &a; // pointer to a 1d array
>>>>>>
>>>>>> No you are wrong because this doesn't mean that this type of pointer
>>>>>> cannot be used as a pointer to a 2d array like so:
>>>>>> char a[3][3];
>>>>>> char (*p)[3] =a;
>>>>>
>>>>> No p is still a pointer to a 1d array; your code is invoking array
>>>>> pointer decay as it is equivalent to:
>>>>>
>>>>> char a[3][3];
>>>>> char (*p)[3] =&a[0];
>>>>>
>>>>> Your understanding of arrays and pointers is flawed.
>>>>
>>>> Your understanding is flawed, the C++ standard defines a pointer to a 
>>>> 2d
>>>> array to be of this type/ level of indirection.
>>>
>>> Your understanding is flawed:
>>>
>>> char(*)[N] is a pointer to a 1d array
>>> char(*)[N1][N2] is a pointer to a 2d array
>>>
>> No this is the pointer TYPE.
>> When a 1d array of chars is converted to a pointer the pointer-type is
>> char* , not char (*)[somesize].
>>
>> Its all explained in the standards.
>>
>>>>
>>>>>
>>>>>>
>>>>>> You take the address of a thus introducing an unneccessary extra 
>>>>>> level
>>>>>> of indirection.
>>>>>
>>>>> Of course; a pointer to an array is an extra level of indirection; a
>>>>> pointer to an array element isn't.
>>>>>
>>>> No. According to the C++ standards, a pointer to an array is a 
>>>> different
>>>> level of indirection, but in the opposite direction from what you are
>>>> saying.
>>>
>>> That was just gibberish.
>>>
>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> Now if Bjarne says one thing and you say it is incorrect, then
>>>>>>>> who is
>>>>>>>> more likely to be wrong?
>>>>>>>
>>>>>>> Your appeal to authority is wrong on two counts:
>>>>>>>
>>>>>>> 1) An appeal to authority is a logical fallacy;
>>>>>>> 2) The authority you are appealing to actually does not agree with
>>>>>>> your claim/argument (as I have described above).
>>>>>> The authority states that char* can point to a single char or an 
>>>>>> array
>>>>>> of chars. Which is in direct agreement with me and disagrees with 
>>>>>> you.
>>>>>
>>>>> Again: there is a difference between "a pointer to" and "points to".
>>>>> Consider:
>>>>>
>>>>> struct base {};
>>>>> struct derived : base {};
>>>>>
>>>>> derived o;
>>>>> base* p = &o;
>>>>>
>>>>> p is a pointer to a base even though it points to an object of derived
>>>>> type.
>>>>>
>>>> Its a pointer to what it points to , its the same thing.
>>>
>>> No it isn't. A pointer has a type; a pointer's type does not have to
>>> be the same type as the object it points to.
>>
>> This is where you fail , because you have on many occassions said that a
>> pointer to T, can only point to a T.
>
> No I haven't; I have said that a pointer to a scalar is not a pointer to 
> an array and have said that "pointer to" is different to "points to" if, 
> like you, we disregard technical accuracy.
>
You are the technically innacurate. If an object X points to an array then 
it is a pointer to an array. Both terms involving the verb "point" where it 
refers to the pointed-to object.

You are incorrectly trying to suggest that the term "is a pointer to" means 
something different than the pointed to object.
If  you mean its a pointer type pointer to X then say that because this is 
the techincally accurate term. Not your twisted nonsense.


>>
>> As you say a char* can only point to a single char and cannot point to
>> an array of chars.
>> But when I post quotations from Stroustrup and the C Faqs , you start to
>> look stupid.
>
> I have said that a pointer to a scalar is not a pointer to an array; a 
> pointer to a scalar can point to an array element of the same scalar type.
>
>>
>> You are inconsistent and seem confused.
>
> I am not inconsistent; you are both confused and cause confusion due to 
> your use of ambiguous terminology and lack of technical accuracy.
>
You are one who is inaccurate , the term "points to" and "is a pointer to" 
both refer to the same pointed to object.
You attempt to use the term "is a pointer to" to mean is of type pointer to.


>>>
>>>>
>>>> You are confused by the pointer-type and what it points to.
>>>
>>> It is obvious to all that it is you who has been confused; is
>>> currently confused and probably will continue to be confused as you
>>> refuse to learn from others.
>>>
>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>> Additionally if the C++ standards defines something and you say its
>>>>>>>> incorrect, then who is more likely to be wrong?
>>>>>>>
>>>>>>> Where have I have said that the C++ Standard is incorrect? I haven't
>>>>>>> said any such thing so you are either lying or are confused.
>>>>>
>>>>>> You said that char (*p)[3] points to a 1d array and not to a 2d 
>>>>>> array,
>>>>>> but the standard states different.
>>>>>>
>>>>>
>>>>> p is a pointer to a 1d array and the standard does not state
>>>>> different; p may point to a 1d array subobject of a 2d array and if it
>>>>> is pointing to the first 1d array subobject of the 2d array then one
>>>>> can say it points to a 2d array but this is informal language and
>>>>> technically inaccurate. As others have said "points into" is a more
>>>>> acceptable term that covers all bases.
>>>>>
>>>> This is utter nonsesne the C++ standard states clearly what a pointer 
>>>> to
>>>> an array is and how it behaves.
>>>> A pointer to a 2d array, when derefernced returns a 1d array subobject.
>>>> And that is a FACT defined in the C++ Standard.
>>>> It doesn't matter how much you try to worm your way around this fact, 
>>>> it
>>>> is clearly defined in the standards and until you accept this fact you
>>>> will always be wrong.
>>>
>>> You are the one spouting utter nonsense; the Standard says no such
>>> thing. Dereferencing a pointer to a 2d array results in a reference to
>>> a 2d array as the following code shows:
>>>
>>> template <typename T, std::size_t N1, std::size_t N2>
>>> void is_a_2d_array(T (&a)[N1][N2])
>>> {
>>> std::cout << "2D array; dimensions = " << N1 << " x " << N2;
>>> }
>>>
>>> int main()
>>> {
>>> char a[7][42]; // 2D array
>>> char (*p)[7][42] =&a; // pointer to a 2D array
>>> is_a_2d_array(*p); // dereferenced pointer to a 2D array is a 2D array
>>> reference
>>> }
>> According to the C++ standards when a 2d array is converted to a pointer
>> the pointer-type is a (n-1) dim array. Thus the correct conversion for a
>> 2d array to a pointer is:
>> char a[7][7];
>> char (*pa)[7] = a;
>
> pa above is *not* a pointer to a 2D array; it is a pointer to a 1D array.

No , it points to a 2d array.
Therefore it is a pointer to a 2d array. Its type is a pointer to a 1d array 
because this is how pointers ot arrays work in C++.

You're POV that if something points to an array it is not a pointer to an 
array is very confused and techincally inaccurate.

>
>> The C++ standard explains this is how a 2d array is converted to a
>> pointer, so that when dereferenced it returns a 1d array(one of its
>> subarrays).
>
> Indeed; this is implicit array-to-pointer conversion; nobody has said that 
> this is incorrect.
>
You are saying it doesn't point to a 2d array, so therefore you don't seem 
to accept that this type of pointer is used to point to a 2d array.


>>
>> What you have done is not a standard array-pointer conversion. You have
>> created an extra level of indirection.
>
> Correct I have created an extra level of indirection to create a pointer 
> to a 2D array; without that extra level of indirection I would be creating 
> a pointer to a 1D array via implicit array-to-pointer conversion.
>
No you are talking about the pointer type but you use incorrect terminology. 
When we say X is a pointer to an array this doesn't not mean the same as x 
is a pointer-type pointer to an array.
The term "is a pointer to" refers to the pointed-to object and is not a term 
that defines the pointer type for example:

void* p = (void*)new int[6];

p is a pointer to an array of 6 ints. p is not a pointer to void.

[toc] | [prev] | [next] | [standalone]


#3754

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-15 14:34 +0100
Message-ID<PdydnXcxKIXk1DXQnZ2dnUVZ8m6dnZ2d@giganews.com>
In reply to#3750
On 15/04/2011 14:24, Paul wrote:
[garbage snipped]
>>> What you have done is not a standard array-pointer conversion. You have
>>> created an extra level of indirection.
>>
>> Correct I have created an extra level of indirection to create a
>> pointer to a 2D array; without that extra level of indirection I would
>> be creating a pointer to a 1D array via implicit array-to-pointer
>> conversion.
>>
> No you are talking about the pointer type but you use incorrect
> terminology. When we say X is a pointer to an array this doesn't not
> mean the same as x is a pointer-type pointer to an array.
> The term "is a pointer to" refers to the pointed-to object and is not a
> term that defines the pointer type for example:

This must be a royal "we" as nobody else (nor the Standard) agrees with you.

>
> void* p = (void*)new int[6];
>
> p is a pointer to an array of 6 ints. p is not a pointer to void.

No; p *is* a pointer to void.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3758

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-15 14:49 +0100
Message-ID<p1Ypp.31452$0j7.8492@newsfe20.ams2>
In reply to#3754
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:PdydnXcxKIXk1DXQnZ2dnUVZ8m6dnZ2d@giganews.com...
> On 15/04/2011 14:24, Paul wrote:
> [garbage snipped]
>>>> What you have done is not a standard array-pointer conversion. You have
>>>> created an extra level of indirection.
>>>
>>> Correct I have created an extra level of indirection to create a
>>> pointer to a 2D array; without that extra level of indirection I would
>>> be creating a pointer to a 1D array via implicit array-to-pointer
>>> conversion.
>>>
>> No you are talking about the pointer type but you use incorrect
>> terminology. When we say X is a pointer to an array this doesn't not
>> mean the same as x is a pointer-type pointer to an array.
>> The term "is a pointer to" refers to the pointed-to object and is not a
>> term that defines the pointer type for example:
>
> This must be a royal "we" as nobody else (nor the Standard) agrees with 
> you.

Well the standard uses the term "is a pointer to" to refer to the pointed to 
object, for example the standard uses terms like:
is a pointer to an incomplete object.

It's obviously refering to the pointed to object, and not the pointer-type.
>
>>
>> void* p = (void*)new int[6];
>>
>> p is a pointer to an array of 6 ints. p is not a pointer to void.
>
> No; p *is* a pointer to void.
>
Your terminology is incorrect, the pointer-type is void pointer but this 
does not mean it points to a void.

p is a pointer to....*drumroll*.. what it points to.  Your attempt to 
suggest otherwise is nothing more than a desperate attempt to make your 
arguemnt correct, but it only makes you even more incorrect.


[toc] | [prev] | [next] | [standalone]


#3761

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-15 14:58 +0100
Message-ID<ItidnZKcsIaA0jXQnZ2dnUVZ7sWdnZ2d@giganews.com>
In reply to#3758
On 15/04/2011 14:49, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:PdydnXcxKIXk1DXQnZ2dnUVZ8m6dnZ2d@giganews.com...
>> On 15/04/2011 14:24, Paul wrote:
>> [garbage snipped]
>>>>> What you have done is not a standard array-pointer conversion. You
>>>>> have
>>>>> created an extra level of indirection.
>>>>
>>>> Correct I have created an extra level of indirection to create a
>>>> pointer to a 2D array; without that extra level of indirection I would
>>>> be creating a pointer to a 1D array via implicit array-to-pointer
>>>> conversion.
>>>>
>>> No you are talking about the pointer type but you use incorrect
>>> terminology. When we say X is a pointer to an array this doesn't not
>>> mean the same as x is a pointer-type pointer to an array.
>>> The term "is a pointer to" refers to the pointed-to object and is not a
>>> term that defines the pointer type for example:
>>
>> This must be a royal "we" as nobody else (nor the Standard) agrees
>> with you.
>
> Well the standard uses the term "is a pointer to" to refer to the
> pointed to object, for example the standard uses terms like:
> is a pointer to an incomplete object.
>
> It's obviously refering to the pointed to object, and not the pointer-type.

You can repeat your nonsense as many times as you like but it will 
remain as incorrect nonsense.  It is obviously not referring to the 
pointed to object as you cannot have an object of an incomplete type; 
you can have an "incomplete object type" though which is the term the 
Standard actually uses not "incomplete object".

>>
>>>
>>> void* p = (void*)new int[6];
>>>
>>> p is a pointer to an array of 6 ints. p is not a pointer to void.
>>
>> No; p *is* a pointer to void.
>>
> Your terminology is incorrect, the pointer-type is void pointer but this
> does not mean it points to a void.

My terminology is correct; p is a pointer to void.

> p is a pointer to....*drumroll*.. what it points to. Your attempt to
> suggest otherwise is nothing more than a desperate attempt to make your
> arguemnt correct, but it only makes you even more incorrect.

p is a pointer to void; what object p points to does not change the type 
of p; "pointer to void" is the type of p.

/Leigh

[toc] | [prev] | [next] | [standalone]


#3762

From"Paul" <pchristor@yahoo.co.uk>
Date2011-04-15 16:43 +0100
Message-ID<xIZpp.31465$0j7.7619@newsfe20.ams2>
In reply to#3761
"Leigh Johnston" <leigh@i42.co.uk> wrote in message 
news:ItidnZKcsIaA0jXQnZ2dnUVZ7sWdnZ2d@giganews.com...
> On 15/04/2011 14:49, Paul wrote:
>>>>>> What you have done is not a standard array-pointer conversion. You
>>>>>> have
>>>>>> created an extra level of indirection.
>>>>>
>>>>> Correct I have created an extra level of indirection to create a
>>>>> pointer to a 2D array; without that extra level of indirection I would
>>>>> be creating a pointer to a 1D array via implicit array-to-pointer
>>>>> conversion.
>>>>>
>>>> No you are talking about the pointer type but you use incorrect
>>>> terminology. When we say X is a pointer to an array this doesn't not
>>>> mean the same as x is a pointer-type pointer to an array.
>>>> The term "is a pointer to" refers to the pointed-to object and is not a
>>>> term that defines the pointer type for example:
>>>
>>> This must be a royal "we" as nobody else (nor the Standard) agrees
>>> with you.
>>
>> Well the standard uses the term "is a pointer to" to refer to the
>> pointed to object, for example the standard uses terms like:
>> is a pointer to an incomplete object.
>>
>> It's obviously refering to the pointed to object, and not the 
>> pointer-type.
>
> You can repeat your nonsense as many times as you like but it will remain 
> as incorrect nonsense.  It is obviously not referring to the pointed to 
> object as you cannot have an object of an incomplete type; you can have an 
> "incomplete object type" though which is the term the Standard actually 
> uses not "incomplete object".
>
>>>
>>>>
>>>> void* p = (void*)new int[6];
>>>>
>>>> p is a pointer to an array of 6 ints. p is not a pointer to void.
>>>
>>> No; p *is* a pointer to void.
>>>
>> Your terminology is incorrect, the pointer-type is void pointer but this
>> does not mean it points to a void.
>
> My terminology is correct; p is a pointer to void.
>
No its not there is no such object as a void in C++. p does not point to a 
void.


>> p is a pointer to....*drumroll*.. what it points to. Your attempt to
>> suggest otherwise is nothing more than a desperate attempt to make your
>> arguemnt correct, but it only makes you even more incorrect.
>
> p is a pointer to void; what object p points to does not change the type 
> of p; "pointer to void" is the type of p.
>
As I have said you are talking about the pointer-type not what it points to.
A pointer-type void pointer, does not point to a void as you incorrectly 
suggest.

[toc] | [prev] | [next] | [standalone]


#3767

FromLeigh Johnston <leigh@i42.co.uk>
Date2011-04-15 17:52 +0100
Message-ID<lpCdnd_ZI89S6jXQnZ2dnUVZ8u6dnZ2d@giganews.com>
In reply to#3762
On 15/04/2011 16:43, Paul wrote:
>
> "Leigh Johnston" <leigh@i42.co.uk> wrote in message
> news:ItidnZKcsIaA0jXQnZ2dnUVZ7sWdnZ2d@giganews.com...
>> On 15/04/2011 14:49, Paul wrote:
>>>>>>> What you have done is not a standard array-pointer conversion. You
>>>>>>> have
>>>>>>> created an extra level of indirection.
>>>>>>
>>>>>> Correct I have created an extra level of indirection to create a
>>>>>> pointer to a 2D array; without that extra level of indirection I
>>>>>> would
>>>>>> be creating a pointer to a 1D array via implicit array-to-pointer
>>>>>> conversion.
>>>>>>
>>>>> No you are talking about the pointer type but you use incorrect
>>>>> terminology. When we say X is a pointer to an array this doesn't not
>>>>> mean the same as x is a pointer-type pointer to an array.
>>>>> The term "is a pointer to" refers to the pointed-to object and is
>>>>> not a
>>>>> term that defines the pointer type for example:
>>>>
>>>> This must be a royal "we" as nobody else (nor the Standard) agrees
>>>> with you.
>>>
>>> Well the standard uses the term "is a pointer to" to refer to the
>>> pointed to object, for example the standard uses terms like:
>>> is a pointer to an incomplete object.
>>>
>>> It's obviously refering to the pointed to object, and not the
>>> pointer-type.
>>
>> You can repeat your nonsense as many times as you like but it will
>> remain as incorrect nonsense. It is obviously not referring to the
>> pointed to object as you cannot have an object of an incomplete type;
>> you can have an "incomplete object type" though which is the term the
>> Standard actually uses not "incomplete object".
>>
>>>>
>>>>>
>>>>> void* p = (void*)new int[6];
>>>>>
>>>>> p is a pointer to an array of 6 ints. p is not a pointer to void.
>>>>
>>>> No; p *is* a pointer to void.
>>>>
>>> Your terminology is incorrect, the pointer-type is void pointer but this
>>> does not mean it points to a void.
>>
>> My terminology is correct; p is a pointer to void.
>>
> No its not there is no such object as a void in C++. p does not point to
> a void.

I never said there was a void object however "pointer to void" is a 
correct term; from the Standard:

3.9.2/4
"Objects of cv-qualified (3.9.3) or cv-unqualified type void* (pointer 
to void), can be used to point to objects
of unknown type."


>
>
>>> p is a pointer to....*drumroll*.. what it points to. Your attempt to
>>> suggest otherwise is nothing more than a desperate attempt to make your
>>> arguemnt correct, but it only makes you even more incorrect.
>>
>> p is a pointer to void; what object p points to does not change the
>> type of p; "pointer to void" is the type of p.
>>
> As I have said you are talking about the pointer-type not what it points
> to.
> A pointer-type void pointer, does not point to a void as you incorrectly
> suggest.

I never said anything "pointed to a void"; I said p was a "pointer to 
void" which is a correct term (see above).

I do not care about terms such as "pointer-type" that you define; I care 
about terms defined by the C++ Standard.

/Leigh

[toc] | [prev] | [next] | [standalone]


Page 6 of 10 — ← Prev page 1 … 4 5 [6] 7 8 … 10  Next page →

Back to top | Article view | comp.lang.c++


csiph-web