kearns@cs.columbia.edu (Steve Kearns) (07/30/90)
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