"qazmlp" <qazmlp1209@red iffmail.com> wrote in message news:db9bbf31.0 308260522.58e07 e63@posting.goo gle.com...[color=blue]
> How can string be converted into a byte array in C++ ?
> Can I used std::bitset<> to do it ?[/color]
Yoiu can just call data() to get a transient const char* that points
to the beginning of a character array. Alternatively, you can copy
it to a vector:
qazmlp <qazmlp1209@red iffmail.com> wrote in message
news:db9bbf31.0 308260522.58e07 e63@posting.goo gle.com...[color=blue]
> How can string be converted into a byte array in C++ ?
> Can I used std::bitset<> to do it ?[/color]
"Ron Natalie" <ron@sensor.com > wrote in message
news:3f4b6a34$0 $23182$9a6e19ea @news.newshosti ng.com...
|
| "qazmlp" <qazmlp1209@red iffmail.com> wrote in message
news:db9bbf31.0 308260522.58e07 e63@posting.goo gle.com...
| > How can string be converted into a byte array in C++ ?
| > Can I used std::bitset<> to do it ?
|
| Yoiu can just call data() to get a transient const char* that points
| to the beginning of a character array. Alternatively, you can copy
| it to a vector:
|
| string s = ...
|
| vector<char> v(s.size());
| copy(s.begin(), s.end(), v.begin());
Comment