Guest User

Untitled

a guest
Jun 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. // Create an array of string objects
  2. std::string arr[] = {"first", "sec", "third", "fourth"};
  3.  
  4.  
  5. // Initialize vector with a string array
  6. std::vector<std::string> vecOfStr(arr, arr + sizeof(arr)/sizeof(std::string));
  7.  
  8. for(std::string str : vecOfStr)
  9. std::cout<<str<<std::endl;
  10.  
  11. vector (InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type());
Add Comment
Please, Sign In to add comment