mardi 26 janvier 2016

(C++) How to convert a string into a character vector? [duplicate]

This question already has an answer here:

How to convert a string such as "Hello, world!" into a vector of characters? I've seen many techniques on how to do this for plain arrays, but none for vectors. Here is my code:

string raw_text = "Hello, world!";
vector<char> char_text;

Any way to make a character vector from raw_text? Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire