title: Passing a struct into a generic function in C
body: <p>I declare a new struct with the name of "Struct"
  I have a generic function that takes in an argument "void *data".</p>
  
  <pre><code>void Foo(void *data)
  </code></pre>
  
  <p>I pass an instance of "Struct" into the generic function.</p>
  
  <pre><code>Struct s;
  Foo(&amp;s);
  </code></pre>
  
  <p>I want to access one of the properties of the struct in the function.</p>
  
  <pre><code>void Foo(void *data) {
      char *word = (char*) data.word;
  }
  </code></pre>
  
  <p>It's not allowed because it doesn't recognize data as a valid struct.</p>
  
  <p>I even try to declare the data as the struct type first, and I get an error.</p>
  
  <pre><code>void Foo(void *data) {
      Struct s = (Struct) data;
      char *word = s.word;
  }
  </code></pre>
  
  <p>I get "conversion to non-scalar type requested".</p>