Search
 
SCRIPT & CODE EXAMPLE
 

CPP

string to vector c++

#include <iostream>
#include <string>
#include <vector>
 
int main()
{
    std::string s = "Hello World!";
 
    std::vector<char> v(s.begin(), s.end());
 
    for (const char &c: v)
        std::cout << c;
 
    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: copy a part of a vector in another in c++ 
Cpp :: Rick Astley - Never Gonna Give You Up 
Cpp :: for in c++ 
Cpp :: iteraate through a vector 
Cpp :: c++ check if vector is sorted 
Cpp :: int_max cpp 
Cpp :: print all elements of vector c++ 
Cpp :: how to declare a function in c++ 
Cpp :: abs in c++ 
Cpp :: how to pass function as a parameter in c++ 
Cpp :: cpp multidimensional vector 
Cpp :: armstrong number in cpp 
Cpp :: prime factorisation of a number in c++ 
Cpp :: c++ get ascii value of char 
Cpp :: concatenate string program in c++ 
Cpp :: on component begin overlap c++ 
Cpp :: c++ binary search 
Cpp :: string.begin() c++ 
Cpp :: how to debug c++ code in vs studio code 
Cpp :: ue4 float to fstring 
Cpp :: c++ add two matrix 
Cpp :: what is thread in c++ 
Cpp :: remove specific element from vector c++ 
Cpp :: c++ ternary operator 
Cpp :: lua table contains 
Cpp :: ++i and i++ 
Cpp :: c preprocessor operations 
Cpp :: how to change colour image to grey in opencv c++ 
Cpp :: print counting in c++ 
Cpp :: print stack without pop c++ 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =