Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!rutgers!cunixf.cc.columbia.edu!cs.columbia.edu!kearns From: kearns@cs.columbia.edu (Steve Kearns) Newsgroups: comp.lang.c++ Subject: Re: delete [] and Turbo C++ Keywords: delete class [] Message-ID: <1990Jul30.142531.28104@cs.columbia.edu> Date: 30 Jul 90 14:25:31 GMT References: <641@atcmpe.atcmp.nl> Reply-To: kearns@cs.columbia.edu (Steve Kearns) Followup-To: comp.lang.c++ Organization: Columbia University Department of Computer Science Lines: 30 In article <641@atcmpe.atcmp.nl> leo@atcmp.nl (Leo Willems) writes: >When shifting from 2.0 to 2.1 I found myself in problems with: > >func(){ > classtype *m = new classtype[10]; > > delete[10] m; >} > >In 2.0 this works fine, in 2.1 not, that compilers suggests: > > delete [] m; > I have noticed that Turbo C++ does not allow the following line with "delete": int * p = new int[50]; delete [50] p; while it does like the following: MyClass * p = new MyClass[50]; delete [50] p; The difference? One has a destructor, and the other does not, near as I can figure out. BUG! -steve