fork(1) download
  1. #include <algorithm>
  2. #include <cstring>
  3. #include <iostream>
  4. #include <iterator>
  5. #include <string>
  6. #include <vector>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11. const char* testdata = "the quick brown fox jumps over the lazy dog.";
  12.  
  13. {
  14. vector<unsigned char> vec(testdata, next(testdata, strlen(testdata)));
  15.  
  16. for(const auto& i : vec) cout << i;
  17. cout << endl;
  18. }
  19. {
  20. basic_string<unsigned char> vec(testdata, next(testdata, strlen(testdata)));
  21.  
  22. cout << vec.data() << endl;
  23. }
  24. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
the quick brown fox jumps over the lazy dog.
the quick brown fox jumps over the lazy dog.