title: How do I modify a pointer to void through a function?
body: <p>I'm trying to create a linked list where you can update the data in a node, but no matter what I try, C doesn't seem to allow me to update the value of a void pointer (or rather where it points to). Here's the test code I have:</p>
  
  <pre><code>void newData(void * d)
  {
      char data[] = "world";
  
      d = &amp;data;
  }
  
  int main()
  {
          char testData[] = "hello";
          void * testPointer = &amp;testData;
  
          printf("TestData is %s\n", (char *)testPointer);
  
          // Modify the data
          newData(&amp;testPointer);
  
          printf("TestData is %s\n", (char *)testPointer);
  }
  </code></pre>
  
  <p>Which just outputs::</p>
  
  <pre><code>TestData is hello
  TestData is hello
  </code></pre>
  
  <p>Am I missing something obvious here? I've also tried using a pointer to a pointer, but to no avail.</p>