Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: ``delete[]p'' -- where is the actual size of *p stored? Message-ID: <56956@microsoft.UUCP> Date: 27 Aug 90 19:26:05 GMT References: Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Distribution: comp Organization: Microsoft Corp., Redmond WA Lines: 12 In article cline@sun.soe.clarkson.edu (Marshall Cline) writes: > main() > { > B* p = new D[100]; > //... > delete [] p; > } C++ will already "do the wrong thing" with any attempts to address the d's referred to by p, thus rendering any problems with delete [] p moot. The right thing is for a compiler to issue a stern warning on the new array statement assigned to an incompatible pointer.