Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

vector size c++

size() function is used to return the size of the vector container or the number of elements in the vector container.
using namespace std;
int main(){
    vector<int> myvector{ 1, 2, 3, 4, 5 };
    cout << myvector.size();
    return 0;
}
//Output = 5
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #vector #size
ADD COMMENT
Topic
Name
2+1 =