title: Error: Invalid Use of Void Expression in C
body: <p>I'm getting an "invalid use of void expression" error regarding the following function:</p>
  
  <pre><code>void remove_data(char* memory, char* bitmap, int pos)
  {
      int i;
  
      i = (int)test_bit(bitmap, pos-1);
  
      if(i != 0)
      {
          memory[pos-1] = NULL;
          toggle_bit(bitmap, pos-1);
      }
  }
  </code></pre>
  
  <p>Now from what I've read on other threads regarding this similar issue this error pops up when the programmer uses something within the function that will generate an output.  However, I'm failing to see what would cause that in the code I've written.</p>
  
  <p>Edit to add:</p>
  
  <p>The toggle bit function used in it is also type void and doesn't return a value.</p>
  
  <pre><code>void test_bit(char * bitmap, int pos)
  {
      int bit;
  
      bit = bitmap[pos/8] &amp; (1&lt;&lt;(pos%8));
      printf("%d\n", &amp;bit);
  }
  </code></pre>
  
  <p>I commented the printf line in test_bit but the error is still there.</p>