title: Variable for While loop not being recognized as initialized
body: <p>I am trying to use a variable as the parameter for my <code>while</code> loop, like shown below.</p>
  
  <pre><code>int compChoice;
  while (compChoice &lt; 8){
  
          compChoice = rand() % 8 + 0;
          cout &lt;&lt; compChoice;
      }
  </code></pre>
  
  <p>My goal is to have a random number generated until an 8 is the output. The issue is that my compiler (visual studio pro 2013) is telling me the variable is not initialized. I removed the <code>while</code> loop and left the variable there and retried, and the compiler then told me the variable <code>compChoice</code> is unreferenced. I also tried just using the last two lines and it worked perfectly. I think I'm doing something wrong with the argument, but I can't figure out what. Any help would be greatly appreciated.</p>