title: Getting a forloop to complete its iterations (simple)
body: <p>I'm writing a piece of code to capitalise letters after full stop basically, but for some reason, every time I test it, when I type something into the command prompt, the program just stops after I hit the return key. Any help would be greatly appreciated thanks. I'm aware that the loop is meant to be infinite until broken, the idea is that the process of capitalisation will continue until the condition is met where the loop is broken.</p>
  
  <pre><code>                if ((text.empty() != 1 ) &amp;&amp; (text.at(text.size() - 1) != '!' ) &amp;&amp; (text.at(text.size() - 1) != '?') &amp;&amp; (text.at(text.size() - 1) != ':' ) &amp;&amp; (text.at(text.size()-1 ) != ',' ) &amp;&amp; (text.at(text.size() - 1 ) != ';' ) &amp;&amp; (text.at(text.size() -1 ) != '=' ) &amp;&amp; (text.at(text.size() -1 ) != '-' ) &amp;&amp; (text.at(text.size() -1 ) != ')' ) &amp;&amp; (text.at(text.size() -1 ) != '}' )  )
          {
              for (i = 0 ;  i &gt;= 0 ; i++)
          {
              text.append("kk") ;
              if (text.find("." , j) &lt; 0 )
                  {
                      text.erase(text.size() - 1, 2) ;
                      text2.append(text) ;
                      writer &lt;&lt; text2 &lt;&lt; endl ;
                      text2.clear() ;
                      j = 0 ;
                      break ;
                  }
                  else
                  {
                      j = text.find("." , j) + 1 ; 
                      k = j + 1;
                      letter = static_cast &lt;int&gt; ( text.at(k) ) ;
                      if (( letter &lt; 123 ) &amp;&amp; ( letter &gt; 96 ))
                          {
                              letter = (letter - 32) ;
                              (text.at(k)) = static_cast &lt;char&gt; (letter) ;
                              text.erase(text.size() - 1, 2) ;
                          }
                      else 
                          {
                              text.erase(text.size() - 1, 2) ;
                              continue ; 
                          }
                  }
          }
          }
          else 
          if (text == "")
          {
              text2.append("\n") ;
              writer &lt;&lt; text2 &lt;&lt; endl ;
              text2.clear() ;
          }
          else 
          {
              text2.append(text) ;
              writer &lt;&lt; text2 &lt;&lt; endl ;
              text2.clear() ;
          }
      }
  </code></pre>