getsize return the size of collection
#include <iostream>
#include <vector>
#include <deque>
using namespace std;
int main() {
int arr[10], Size;
Size = sizeof(arr)/sizeof(arr[0]);
cout<<"array[10]. Size: "<<Size<<endl;
vector<int> g1;
for (int i = 1; i <= 5; i++)
g1.push_back(i);
cout << "vector<int>. Size: " << g1.size()<<endl;
deque<int> gquiz;
cout << "gquiz. Size() : " << gquiz.size();
return 0;
}
Comments
Leave a comment