title: Setting a void pointer's value to an integer
body: <p>Let's say you have a node <code>struct</code>, with the attribute, <code>void* data</code>.</p>
  
  <p>Is it possible to set the value of this pointer to some arbitrary integer value (ie, rather than doing something like <code>node-&gt;data = &amp;random_integer</code>).</p>
  
  <p>I try the following lines:</p>
  
  <pre><code>NodePtr node = malloc(sizeof(Node));
  *((int*)(node-&gt;data)) = 0;
  </code></pre>
  
  <p>This compiles without errors and warnings, but causes a segfault.  I'm not exactly sure why.</p>
  
  <p>I could easily set the void pointer to some <code>&amp;int</code>, but then I would have to allocate space for the <code>&amp;int</code> ... and that seems unnecessary for such a simple operation.  </p>