Answer by Jessica Young for How can I get the size of an std::vector as an int?
Easy :) Use the following code instead of your code.auto size = v.size();
View ArticleAnswer by Baum mit Augen for How can I get the size of an std::vector as an int?
In the first two cases, you simply forgot to actually call the member function (!, it's not a value) std::vector<int>::size like this:#include <vector>int main () { std::vector<int>...
View ArticleHow can I get the size of an std::vector as an int?
I tried:#include <vector>int main () { std::vector<int> v; int size = v.size;}but got the error:cannot convert 'std::vector<int>::size' from type 'std::vector<int>::size_type...
View Article