delete array; not delete [] array;
delete [] arr;
is equivalant to
delete arr[0]; delete arr[1]; ... delete arr[k];
------------------------------------------------
defination from msdn:
The delete operator destroys the object created with new by deallocating the memory associated with the object.
------------------------------------------------
however your array is array of primative type bool
now try this
Class Bool
{
public bool myBool;
};
Bool *flag2 = new Bool[8];
delete [] flat2;
is equivalant to
delete arr[0]; delete arr[1]; ... delete arr[k];
------------------------------------------------
defination from msdn:
The delete operator destroys the object created with new by deallocating the memory associated with the object.
------------------------------------------------
however your array is array of primative type bool
now try this
Class Bool
{
public bool myBool;
};
Bool *flag2 = new Bool[8];
delete [] flat2;

You may say I'm a dreamer
but I'm not the only one...