Created
April 27, 2022 05:18
-
-
Save nathanjackson/f4116ed0313a481b7d5edfb621e99fc4 to your computer and use it in GitHub Desktop.
read file using istreambuf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <iterator> | |
#include <vector> | |
int main(int argc, char** argv) | |
{ | |
std::ifstream ifs(argv[1], std::ios::binary); | |
std::istreambuf_iterator<char> begin(ifs), end; | |
std::vector<uint8_t> data(begin, end); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment