title: Variable being used without being initialized? C Language
body: <p>I can't quite figure out what my issue is here. I keep getting an error in my code. </p>
  
  <p>Error: Run-Time Check Failure: Variable used without being initialized.
  : warning C4700: uninitialized local variable 'b' used</p>
  
  <p>can someone help me solve this problem ? Any help would be appreciated.I'm using visual studio as a compiler for C and I'm a beginner in it and this is a one of the assignment. I don't see why  i keep getting  this issue if i input "int b;" in the beginning of the program. Wouldn't that variable be initialized?</p>
  
  <p>Here is the code: </p>
  
  <pre><code> #include &lt;stdio.h&gt;
  
  
    //Create a program that asks the user to enter a number until the user enters a -1 to   stop
    int main() 
    {
     int b;
  
        //as long as the number is not -1,  print the number on the screen
   while(b!=-1) {
   printf("Hello there! would you please enter a number?");
   scanf(" %d",&amp;b);
  
   //as long as the number is not -1,  print the number on the screen
   if(b!=-1){
   printf("Thank you for your time and consideration but the following %d you entered  wasn't quite what we expected. Can you please enter another?\n",b);
  
      //When the user enters a -1 print the message “Have a Nice Day :)” and end the program
   }else {
   printf("Have a Nice Day :), and see you soon\n");
   }
      }
  return 0;
  }
  </code></pre>