Created
July 8, 2016 05:54
-
-
Save Lunaphied/d36b9189413646ee028a4681a1e73ca7 to your computer and use it in GitHub Desktop.
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
| std::string read_file ( const char* file_path ) | |
| { | |
| std::ifstream in ( file_path, std::ios::in ); | |
| if ( in ) { | |
| std::string contents; | |
| in.seekg ( 0, std::ios::end ); | |
| contents.resize ( in.tellg() ); | |
| in.seekg ( 0, std::ios::beg ); | |
| in.read ( &contents[0], contents.size() ); | |
| in.close(); | |
| return contents; | |
| } | |
| std::abort(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment