title: Float Pointer to Hexadecimal
body: <p>The code I use to convert <code>hexadecimals &gt; float pointers</code>:</p>
  
  <pre><code>from ctypes import *
  
  def convert(s):
      i = int(s, 16)                   # convert from hex to a Python int
      cp = pointer(c_int(i))           # make this into a c integer
      fp = cast(cp, POINTER(c_float))  # cast the int pointer to a float pointer
      return fp.contents.value         # dereference the pointer, get the float
  
  print convert("41973333")    # returns 1.88999996185302734375E1
  
  print convert("41995C29")    # returns 1.91700000762939453125E1
  
  print convert("470FC614")    # returns 3.6806078125E4
  </code></pre>
  
  <p>But I am not sure how I could reverse this effect, so to say.</p>
  
  <p>I'm trying to go from <code>float pointer &gt; hexadecimal</code>, instead of <code>hexadecimal &gt; float pointer</code>.</p>