title: Difference between Auto and Void?
body: <p>I am reading the C++ Primer Book (fifth edition) and I have a question upon the book i am reading. It says:</p>
  
  <blockquote>
    <p>The type <code>void*</code> is a special pointer type that can hold the address of
    any object. Like any other pointer, a <code>void*</code> pointer holds an address,
    but the type of the object at that address is unknown.</p>
  </blockquote>
  
  <p>Ok, so I understand that but… I have many contradictions to the statement. First of all, can't you use <code>auto</code>? Doesn't it do the same thing as <code>void</code>? Meaning aren't</p>
  
  <pre><code>void *somePtr;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>auto *somePtr;
  </code></pre>
  
  <p>the same?</p>
  
  <p>Second of all it says the type of the attached address is unknown. Can't you use <code>typeid</code> to get the type? Like this:</p>
  
  <pre><code>int a = 5;
  auto *somePtr = 5;
  std::cout &lt;&lt; typeid(*somePtr).name() &lt;&lt; std::endl;
  </code></pre>