title: C++ style: Stroustrup' s placement of pointer asterisks
body: <p>Does anyone know why Stroustrup's style is the placement of pointers as follows?  Specifically, what Stroustrup has provided for guidance about this matter?</p>
  
  <pre><code>int* p;
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>int *p;
  </code></pre>
  
  <p>because declaring multiple variables would require the asterisk next to each variable name.  Which would result in:</p>
  
  <pre><code>int* p, *x;
  </code></pre>
  
  <p>vs</p>
  
  <pre><code>int *p, *x;
  </code></pre>
  
  <p>In K&amp;R C book, they explain that the asterisk/pointer is used as a mnemonic to aid in understanding.  I find it odd that the pointer/asterisk is tied to the type, vs the variable as the second of each example shows.  Interested if there is some background to why the first style is chosen.</p>
  
  <p>Hoping for some quote from Stroustrup in the reasoning for this.</p>
  
  <p>I'm adding in K&amp;R C 2nd Edition grammar Page 235 where the asterisk (pointer) is tied to the declarator, which is an identifier.</p>
  
  <p><a href="https://i.stack.imgur.com/OIqcS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/OIqcS.png" alt="K&amp;R p235 2nd Ed"></a></p>
  
  <p><strong>ANSWER</strong>
  In this <a href="http://www.stroustrup.com/bs_faq2.html#whitespace" rel="noreferrer">article from Stroustrup</a> on coding style.  He explains that both are valid and it depends on programmer preference.</p>
  
  <p>I disagree that this is an opinion based question.  Stroustrup's article clearly answers the question without opinion.</p>