fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. int main() {
  7. string a = "Hello world";
  8. vector<unsigned char> v(a.begin(), a.end());
  9. for (int i= 0 ;i< v.size(); ++i) {
  10. cout << v[i] << endl;
  11. }
  12. string s(v.begin(), v.end());
  13. cout << s << endl;
  14. return 0;
  15. }
Success #stdin #stdout 0.02s 2856KB
stdin
Standard input is empty
stdout
H
e
l
l
o
 
w
o
r
l
d
Hello world