Answers for "what does emplace_back back return in c++"

0

what does emplace_back back return in c++

// vector::emplace_back
#include <iostream>
#include <vector>

int main ()
{
  std::vector<int> myvector = {10,20,30};

  myvector.emplace_back (100);
  myvector.emplace_back (200);

  std::cout << "myvector contains:";
  for (auto& x: myvector)
    std::cout << ' ' << x;
  std::cout << '\n';

  return 0;
}
Posted by: Guest on July-02-2020

Code answers related to "what does emplace_back back return in c++"

Browse Popular Code Answers by Language