title: Assign value to member of struct using double pointer
body: <p>I have a function that takes a double pointer to a struct and assigns a value. However I get an "access violation writing location ..." when trying to access the member <code>member1</code>.
  This is my code:</p>
  
  <pre><code>struct mystruct{
    unsigned int member1;
    void * data;
  };
  
  int main(){
  
    mystruct **foo = new mystruct *;
    bar(foo);
  
  }
  
  void bar(unsigned int val, mystruct ** foo)
  {
      (*foo)-&gt;member1 = val;
  }
  </code></pre>