Search
 
SCRIPT & CODE EXAMPLE
 

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] << '
';
   }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: length of string c++ 
Cpp :: C++ Find the sum of first n Natural Numbers 
Cpp :: string reverse stl 
Cpp :: max value of double c++ 
Cpp :: prime numbers less than a given number c++ 
Cpp :: c++ check if vector is sorted 
Cpp :: how print fload wiht 2 decimal in c++ 
Cpp :: c++ int main() 
Cpp :: footnote appears in the middle latex 
Cpp :: nth node from end of linked list 
Cpp :: find max value in array c++ 
Cpp :: find primes in cpp 
Cpp :: sleep c++ 
Cpp :: why are inline keyword in header c++ 
Cpp :: convert integer to string c++ 
Cpp :: cpp cin 
Cpp :: index string c++ 
Cpp :: check if a string is palindrome cpp 
Cpp :: reverse function in cpp string 
Cpp :: cpp vector2 
Cpp :: remove from vector by value c++ 
Cpp :: string to integer in c++ 
Cpp :: sorting using comparator in c++ 
Cpp :: how to declare a 2D vector in c++ of size m*n with value 0 
Cpp :: c++ get line 
Cpp :: cpp func as const 
Cpp :: c++ contains 
Cpp :: Converting to string c++ 
Cpp :: word equation numbers 
Cpp :: c++ header boilerplate 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =