# Pb with array of classes

**URL:** <https://forum.juce.com/t/pb-with-array-of-classes/1982>\
**Category:** General JUCE discussion\
**Created:** [August 5, 2007, 9:29pm UTC](https://forum.juce.com/t/pb-with-array-of-classes/1982 "2007-08-05T21:29:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geoffroy](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@geoffroy](https://forum.juce.com/u/geoffroy)\
**Post date:** [August 5, 2007, 9:29pm UTC](https://forum.juce.com/t/pb-with-array-of-classes/1982/1 "2007-08-05T21:29:09Z")

</div>

Hello

Me again, sorry.

I have an exception raised by Juce when I’m trying to delete an array, i.e. calling

`delete[] peaksArray;
`

Of course peaksArray is not NULL at that point.

My array is defined as

```auto

```

where

`	// structure to store min & max points of a block
	class BlockMinMax {
	public:
		float min;
		float max;
	};
`

Any idea ?  
Maybe I shouldn’t use the new operator with arrays ?  
I saw the juce\_malloc macro but doesn’t know it I must use something else than new for arrays of classes.

thanks

geoffroy

---

<div class="post-metadata">

**Author:** ![geoffroy](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@geoffroy](https://forum.juce.com/u/geoffroy)\
**Post date:** [August 6, 2007, 8:35am UTC](https://forum.juce.com/t/pb-with-array-of-classes/1982/2 "2007-08-06T08:35:43Z")

</div>

Forget it! A newbie problem.  
I just had written past the end of the array before killing it…

sorry

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 12, 2017, 10:21am UTC](https://forum.juce.com/t/pb-with-array-of-classes/1982/3 "2017-05-12T10:21:41Z")

</div>

Closed on May 12, 2017, 10:21am UTC


