title: What does this mean: a pointer to void will never be equal to another pointer?
body: <p>One of my friends pointed out from &quot;Understanding and Using C Pointers - Richard Reese, O'Reilly publications&quot; the second bullet point and I wasn't able to explain the <strong>first</strong> sentence from it. What am I missing?</p>
  <blockquote>
  <h5>Pointer to void</h5>
  <p>A pointer to void is a general-purpose pointer used to hold references to any data type. An example of a pointer to void is shown below:</p>
  <pre><code>void *pv;
  </code></pre>
  <p>It has two interesting properties:</p>
  <ul>
  <li>A pointer to void will have the same representation and memory alignment as a pointer to <code>char</code>.</li>
  <li><em>A pointer to void will never be equal to another pointer.</em> However, two void pointers assigned a <code>NULL</code> value will be equal.</li>
  </ul>
  </blockquote>
  <p>This is my code, not from the book and all pointers are having the same value and are equal.</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
    int a = 10; 
    int *p = &amp;a; 
    void *p1 = (void*)&amp;a;
    void *p2 = (void*)&amp;a;
  
    printf(&quot;%p %p\n&quot;,p1,p2);
    printf(&quot;%p\n&quot;,p);
    
    if(p == p1) 
      printf(&quot;Equal\n&quot;);
    if(p1 == p2) 
      printf(&quot;Equal\n&quot;);  
  }
  </code></pre>
  <p>Output:</p>
  <pre><code> 0x7ffe1fbecfec 0x7ffe1fbecfec
   0x7ffe1fbecfec
   Equal
   Equal
  </code></pre>