title: Run-Time Check Failure #3 - The variable 'direct' is being used without being initialized
body: <p>In this part of code is an error. It says </p>
  
  <blockquote>
    <p>"Run-Time Check Failure #3 - The variable 'direct' is being used
    without being initialized."</p>
  </blockquote>
  
  <p>How can I fix this error ?</p>
  
  <pre><code>bool loop=true;
  int direct;
  
  al_install_keyboard();
  
  ALLEGRO_TIMER *timer = al_create_timer (0.4);
  ALLEGRO_EVENT_QUEUE *keystroke = al_create_event_queue();
  al_register_event_source(keystroke ,al_get_keyboard_event_source() );
  al_register_event_source (keystroke , al_get_timer_event_source(timer));
  al_start_timer(timer);
  
  do{
      ALLEGRO_EVENT input;
      al_wait_for_event(keystroke , &amp;input );
      if (input.type == ALLEGRO_EVENT_KEY_DOWN){
          switch(input.keyboard.keycode){
          case ALLEGRO_KEY_DOWN: direct=DOWN; break;
          case ALLEGRO_KEY_UP : direct=UP;break;
          case ALLEGRO_KEY_LEFT: direct=LEFT;break;
          case ALLEGRO_KEY_RIGHT: direct=RIGHT;break;
          case ALLEGRO_KEY_ESCAPE: loop= false;
          }
      }
  
      if(input.type==ALLEGRO_EVENT_TIMER){
          switch(direct){
          case DOWN: moove_snake(DOWN) ; break;
          case UP: moove_snake(UP) ; break;
          case LEFT: moove_snake(LEFT) ; break;
          case RIGHT: moove_snake(RIGHT) ; break;
          }
      }
  
  }while (loop);
  </code></pre>