title: Signedness of int in while comparing with string.size() showing warning
body: <p>So, i was writing down this code</p>
  
  <pre><code>void shortened(string s){
      int cnt=0;
      for(int i=0;i&lt;s.size()-1;++i){
          cnt++;
      }
      //some extra code
  }
  </code></pre>
  
  <p>this for loop showed me a warning and i.e. of comparison of integer expressions of different signedness int and string::size_type. But as soon as I changed int i = 0 to unsigned int i=0 there was no warning. I know that the length of the string can never be zero and that's why the warning was shown because int i can hold negative numbers as well. But why the warning was being shown in the first place?</p>
  
  <pre><code> i-0;i&lt;s.size()-1
  </code></pre>
  
  <p>in itself was very complete. I need to clear my doubt.</p>