Cant clean memory with delete[] in C++ : After uncommenting `delete[] array;` Im getting this error
`CRT detected that the application wrote to memory after end of heap buffer`
What do I have to do to correct this problem?
```
#include <iostream>
using namespace std;

int main(){
    char ch;
    char* array = new char[0];
    int array_index = 0;
    while(cin>>ch){
        if(ch != '!'){
            array[array_index++] = ch;
        }else{
            break;
        }
    }

    //delete[ ] array;

}

```