title: <where do I convert?> warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data
body: <p>The code below gives me following warning in line 174:</p>
  
  <p>warning C4244: 'initializing' : conversion from '__int64' to 'int', possible loss of data</p>
  
  <p>but I don't really understand why. I have vector <code>s</code> of <code>__int64</code>'s, but i'ts size is integer, <code>k</code> is also integer, so everything should be fine. Or maybe <code>k:s</code> works different than I thought?</p>
  
  <pre><code>#define _USE_MATH_DEFINES
  
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;cmath&gt;
  
  
  using namespace std;
  
  __int64 count( vector&lt;__int64&gt; s, int n )
  {
      vector&lt;__int64&gt; table(n+1,0);   // or: 0LL instead 0
      table[0] = 1;                   // or: 1LL instead 1
      for ( int k : s )    /* 174 */  // or:  for ( auto&amp; k : s )`
          for(int j=k; j&lt;=n; ++j)
              table[j] += table[j-k];
       return table[n];
  }
  
  
  int main()
  {
  // some code here
      cin.get();
      return 0;
  }
  </code></pre>