*
:
>
> how to convert a string to a vector of unsigned char ?
std::string s = "abra kadabra";
std::vector<unsigned char> v( s.begin(), s.end() );
> I used to iterate trough the string to set the vector, but I think
> this is not the best way to do this.
> I'm a beginner with the STL
>
> How about allocating the vector ? should I know before the size ?
Huh.
> And I would like to do then opposite conversion, from an unsigned char
> vector to a string.
> How to do this ?
std::string t( v.begin(), v.end() );
> how about special caracters ? (\n for example)
Irrelevant.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?