title: Declaring variables inside loops, good practice or bad practice?
body: <p><strong>Question #1:</strong> Is declaring a variable inside a loop a good practice or bad practice?</p>
  
  <p>I've read the other threads about whether or not there is a performance issue (most said no), and that you should always declare variables as close to where they are going to be used. What I'm wondering is whether or not this should be avoided or if it's actually preferred.</p>
  
  <p>Example:</p>
  
  <pre><code>for(int counter = 0; counter &lt;= 10; counter++)
  {
     string someString = "testing";
  
     cout &lt;&lt; someString;
  }
  </code></pre>
  
  <p><strong>Question #2:</strong> Do most compilers realize that the variable has already been declared and just skip that portion, or does it actually create a spot for it in memory each time?</p>