why if i delete 2 times (f.e i forgot) array (heap) it does not matter, i will get double free detected error, but when i make something like : array = nullptr; and delete the array second times in another place of the program i wont get the error. Because of that the nullptr makes pointer of variable NULL (0x0000000) and if we delete this memory many times with ::operator delete nothing will happen yea???
For simplicity you can think of a pointer as an address to the memory. When you allocate something, you get address to that, no other parts of the program know that something exists in that memory.
If you delete it, the address is still points to that memory, even though that memory is freed (doesn't belong to your app anymore).
If you try to delete an object by that address again you get undefined behavior (you can hope it be just a crash).
Calling delete on NULL does nothing, so if you null a pointer after deleting it, then you
1. can check if it still points to something by comparing to NULL
2. can delete it safely (e.g. in an object destructor)
Note that if you have two pointers to one object, if you null one of them the other will still point to previous memory, so it won't save you from double free problem.
In C++ there are mechanisms that help you not to think about all these things called "smart pointers", they manage ownership, free memory when you don't need it anymore (prevent memory leaks), set themself to be nullptr when they are freed and do other safety things.
Also, in C++ we use nullptr instead of NULL, nullptr is safer type wise, can't accidentally use it as number.