Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <vector>
- #include <iterator>
- int main()
- {
- std::ifstream ifs("test.txt");
- ifs.unsetf(std::ios::skipws);
- std::vector<char> buf(
- (std::istream_iterator<char>(ifs)),
- std::istream_iterator<char>());
- std::ofstream ofs("testcopy.txt", std::ios::binary);
- ofs.write(buf.data(), buf.size());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement