Created
February 23, 2014 20:24
-
-
Save beakr/9176722 to your computer and use it in GitHub Desktop.
Always keep this Gist close to your heart. You will love it forever.
This file contains 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
char * readfile(const char * f) | |
{ | |
ifstream in(f, std::ifstream::binary); | |
in.seekg(0, in.end); | |
int size = in.tellg(); | |
in.seekg(0); | |
char * buf = new char[size]; | |
in.read(buf, size); | |
return buf; | |
delete[] buf; | |
in.close(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment