title: Running for loop depending on size of string vector
body: <p>I have made a string vector</p>
  
  <pre><code>vector&lt;string&gt; actor_;
  </code></pre>
  
  <p>and then added elements in it using push_back.</p>
  
  <p>I now want to display all of them, for which I need to run a loop according to the number of elements in the vector. For that, I need to run the following loop:</p>
  
  <pre><code>for (int i = 0; i &lt; (int)actor_.size; i++)
  {
  }
  </code></pre>
  
  <p>but this returns the following error:</p>
  
  <hr>
  
  <pre><code>error C2440: 'type cast' : cannot convert from 'unsigned int (__thiscall std::vector&lt;_Ty&gt;::* )(void) const' to 'int'
  1&gt;        with
  1&gt;        [
  1&gt;            _Ty=std::string
  1&gt;        ]
  1&gt;        There is no context in which this conversion is possible
  </code></pre>
  
  <hr>