Good, so I free alocated space by 'delete array'.
But if I wanted to get rid of (and free space) of just one, lets say last, element of the array, would I delite it by 'delete array[3]' ?
If you use p = new T[X] where p is of type T*, T is a type, and X is a number, then you free the array with delete[] p. This frees the entire array. There is no method to free "just one element".
If you use p = new T, then you free the single object with delete p.
if array of alocated memory locations is delited by delete[] p;
what will happen if I insted write delete p; like for single elements?
This doesn't quite make sense to me. If something allocated thusly: p = new P[] and is then deleted like so: delete p instead of delete [] p your code invokes undefined behavior, and anything can happen, including your program working normally or a pink elephant materializing above your head and crushing you to death when it falls.
do I have to specify the lenght like delete[4] p; ?