title: How do you check if a pointer, in C, is of a certain type?
body: <p>How do you check if a pointer is of a certain type?</p>
  
  <p>Using <code>sizeof</code> is not sufficient.</p>
  
  <p>I am trying to avoid putting id-numbers into my structs to identify their type. The assumption is that maybe gcc puts a struct definition somewhere in the process, and maps the definition to the allocated memory at a pointer. If this is true, I'd think there would be someway to check for a pointers type.</p>