From 7151377108361652965
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8366734ec6aad121,start
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-06-05 13:35:11 PST
Newsgroups: comp.std.c++
Path: nntp.gmd.de!Germany.EU.net!EU.net!uunet!psinntp!lehman.com!mexico!eschwarz
From: eschwarz@shearson.com (Edward Schwarz)
Subject: new foo[0]
Message-ID: <CquD6C.LEK@lehman.com>
Sender: news@lehman.com (News)
Nntp-Posting-Host: mexico
Reply-To: eschwarz@shearson.com
Organization: Lehman Brothers, Inc.
Date: Fri, 3 Jun 1994 22:01:23 GMT
Lines: 27

given a class

class foo 
{
public:    
   int x,y; 	
   foo()  { x=0; y=0; }
   ~foo() { x=1; y=1; }
}; 

What, if any, is the difference between 

A)	foo* myfoo0 = new foo[0];

and

B)	foo* myfoo1 = new foo[1];

The ARM says that A) will retun a pointer to an object, and that distinct calls will return distinct objects. This would seem to imply that there is no difference between A) and B).

Thanks for any comments on this one.

---
Ed Schwarz - eschwarz@shearson.com 





