Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

string vector c++

#include <string>
#include <vector>
#include <iostream>

using namespace std;

int main() {

   vector<string> v;

   string s = "one";
   v.push_back(s);

   s = "two";
   v.push_back(s);

   s = "three";
   v.push_back(s);

   for (int i = 0; i < v.size(); ++i)
   {
      cout << v[i] << '
';
   }
}
Source by www.oreilly.com #
 
PREVIOUS NEXT
Tagged: #string #vector
ADD COMMENT
Topic
Name
4+9 =