C++ : deleting different static and dynamic pointer type
<p>I have a piece of dumb code for which i need some explanations. </p>

<pre><code>int main() {
   int *ptr_i = new int[100];
   char *ptr_c = (char *)ptr_i;
   delete [] ptr_c;
   return 0;
}
</code></pre>

<p>First of all I was expecting this code to crash but it didn't which i believe is because in this case the allocater will keep a track of how many bytes to de-allocate. I ran valgrind also on this code and it shows no memory leak.
I need clarification regarding following :</p>

<ol>
<li><p>In case when dealing with POD data type, how will a c'tor of char differ from that of int ?</p></li>
<li><p>Apart from coding convention, what other problems can this code lead to ? </p></li>
</ol>