#include#include using namespace std; int main() { vector myVector = {1, 2, 3, 4, 5}; int sizeOfVector = myVector.size(); cout << "The size of myVector is: " << sizeOfVector << endl; return 0; }
#includeusing namespace std; int main() { int myArray[] = {1, 2, 3, 4, 5}; int sizeOfArray = sizeof(myArray)/sizeof(myArray[0]); cout << "The size of myArray is: " << sizeOfArray << endl; return 0; }
#include#include
#includeOutput: The size of mySet is: 5 Package/Library: STL#include using namespace std; int main() { set mySet = {1, 2, 3, 4, 5}; int sizeOfSet = mySet.size(); cout << "The size of mySet is: " << sizeOfSet << endl; return 0; }