int x = 10; cout << "Size of integer variable x: " << sizeof(x) << " bytes" << endl;
Size of integer variable x: 4 bytes
double y = 3.14159265; cout << "Size of double variable y: " << sizeof(y) << " bytes" << endl;
Size of double variable y: 8 bytes
#includeusing namespace std; vector nums(10); // create a vector of 10 integers cout << "Size of vector: " << sizeof(nums) << " bytes" << endl;
Size of vector: 28 bytesIn this example, the `vector` container has a size of 28 bytes, which includes the size of the internal data structures used to manage the collection of integers.