title: Float value casted to char
body: <p>In the below code,</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(){
    char array[] = {'1', 2, 5.2};
    char* my_pointer = array[2];
    printf("%c", *my_pointer);
  }
  </code></pre>
  
  <p><code>5.2</code> is stored in IEEE 754 representation in memory, <code>char</code> picks 8 bits(first) from this float representation, due to little endian format.</p>
  
  <p>C is a loosely typed language. Am allowed to cast <code>float</code> to <code>char</code>.</p>
  
  <p>Why the program is core dumped? </p>