fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. #include <array>
  4.  
  5. int main()
  6. {
  7. std::vector<float> v;
  8. for( auto f : { 1.0, 2.0, 3.0 } ) v.push_back(f);
  9. std::cout << sizeof(v) << "-" << v.capacity() << std::endl;
  10. std::cout << sizeof(std::array<float,3>) << std::endl;
  11. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
24-4 12