fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4. typedef unsigned char BYTE;
  5. int main() {
  6. // vector of BYTE, contains these 7 elements for example: (0,30,85,160,155,93,0)
  7. std::vector<BYTE> data = {0, 35, 35 ,38};
  8.  
  9. // method 2
  10. std::string string2(data.begin(),data.end());
  11. cout<< (string2.data()+1) << " size:"<< string2.size() <<endl;
  12. cout.write(string2.data()+1, string2.size()-1); // the c++98 way
  13. cout<< endl;
  14. return 0;
  15. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
##& size:4
##&