fork download
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <vector>
  5.  
  6. void function(const std::vector<char>& array, const std::string& filename)
  7. { std::ofstream(filename).write(&array[0], array.size());}
  8.  
  9. int main() {
  10. std::string tmp("HELLO WORL");
  11. std::vector<char> array(tmp.begin(), tmp.end());
  12. std::cin >> tmp;
  13. function(array, tmp);
  14. }
Success #stdin #stdout 0s 2964KB
stdin
Standard input is empty
stdout
Standard output is empty