From -1251015842209742362
X-Google-Thread: 7894ca11fe,9498f84f2fe77780
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 07 Sep 2009 02:30:50 -0500
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
To: (Usenet)
From: Ron <ron.natalie@gmail.com>
Newsgroups: comp.std.c++
Subject: Re: delete multiple pointers
Organization: http://groups.google.com
Sender: cppmods@cs.rpi.edu
Approved: james.dennett@gmail.com
Message-ID: <7541342d-01b6-4f3a-a9ab-280ea54e359c@r34g2000vba.googlegroups.com>
References: <5abb2eee-8508-4309-b697-1958e225c7ad@o10g2000yqa.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
X-Original-Date: Sat, 5 Sep 2009 21:09:38 -0700 (PDT)
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Date: Mon,  7 Sep 2009 02:21:58 CST
Lines: 29
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-vdP//Q6IhnY3F/jZObYETWBEvzO6Q7QvZ5NLwy7fVvbpfJxPhfOIpZ19Ctf6apu5MplSi9HTKHL2I8T!RGVUxrmuy3Bei46MJ3zeZGaL2oc2IQEDQPWVEQNB6dDFkLrlV8qftDF8L2rSkz8pA5TtrvKR97te!2WNf1I/VxLXnUKidZ3xzaB2T1ZU=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39
Xref: g2news2.google.com comp.std.c++:1356

On Sep 6, 12:26 am, "cdm.hender...@googlemail.com"
<cdm.hender...@googlemail.com> wrote:

>
>      delete[] p1,p2;

>
> I assume then, that the comma operator here is seen as the compiler as
> separating two statements; "delete[] p1" and "p2", and that "p2" as
> statement does nothing but is not an error. Is my understanding of
> this correct?
>

It is a comma operator.  But what you have is two subexpressions
in one statement.   The first subexpression delete[] p1 is evaluated
and then it's value discarded and the right subexpression p2 is
evaluated and it becomes the value of the full expression (which
is ignored).

p2 is not deleted.



--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



