Running for loop depending on size of string vector
- by xbonez
I have made a string vector
vector actor_;
and then added elements in it using push_back.
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:
for (int i = 0; i < (int)actor_.size; i++)
{
}
but this returns the following error:
error C2440: 'type cast' : cannot convert from 'unsigned int (__thiscall std::vector<_Ty::* )(void) const' to 'int'
1 with
1 [
1 _Ty=std::string
1 ]
1 There is no context in which this conversion is possible