title: Modify content using pointers
body: <p>I have an exercise where I have to create a certain amount of pthreads to de-noise an image but I am having issues with my pointers.  Each thread gets the input_image but then all the threads need to be able to write to the same output_image.  Here are the parts that are relevant. </p>
  
  <pre><code>struct task{
      int start_row, stop_row, window_size;
      image_matrix input_image;
      image_matrix * output_image; //holds the address of the original output_matrix
  };
  
  void* func( void* arg ){
      task* t_arg = ( task* )arg;
  
      image_matrix&amp; input = t_arg-&gt;input_image;
  
      //image_matrix&amp; output = t_arg-&gt;output_image; 
      image_matrix * matrix_address= t_arg-&gt;output_image; //&lt;-----
  
      for(int y = start; y&lt;=stop; y++){
          for(int x=0;x&lt;input.get_n_cols();x++){
              float filtered_value = median_filter_pixel(input, y, x, window_size);
              *matrix_address.set_pixel(y,x,filtered_value); //&lt;------2
          }
      }
      pthread_exit( NULL );
  }
  
  
      //This is how I set the output_image in main() but I'm pretty sure
      //this is good.  Filtered image is just   
      td[j].output_image = &amp;filtered_image;
  </code></pre>
  
  <p>This give the error below but I don't understand why.  The value pointed to by matrix_address is of type image_matrix so it should have all the attributes of an image_matrix.  I have tried everything that makes sense to me but nothing is working.  Also when I take away the dereference operator from the line marked 2 it gives the same error which also doesn't make sense to me.</p>
  
  <pre><code>request for member ‘set_pixel’ in ‘output_address’, which is of pointer
      type ‘image_matrix*’ (maybe you meant to use ‘-&gt;’ ?)
  </code></pre>