title: How do I fix a timer that doesn't want to start?
body: <p>I made this timer a few days ago and today and decided to mess around with it. I wanted it to be able to stop whenever I type in &quot;stop&quot; but I think I did something wrong and now the timer doesn't start at all. What's the reason for this?</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;unistd.h&gt;
  
  int main(){
      int hr=0, min=0, sec=0;
      std::string x;
      while(true){
          system(&quot;clear&quot;);
          std::cout &lt;&lt; hr &lt;&lt; &quot; : &quot; &lt;&lt; min &lt;&lt; &quot; : &quot; &lt;&lt; sec &lt;&lt; std::endl;
          sec++;
          if(sec==60){
              min++;
              sec=0;
              if(min==60){
                  hr++;
                  min=0;
                  if(hr==1){
                      hr=0;
                  }
              }
          }
          sleep(1);
          std::cin &gt;&gt; x;
          if (x == &quot;stop&quot;)
          {
              break;
          }
          
      }
      return 0;
  }
  </code></pre>