Skip to content

Instantly share code, notes, and snippets.

@shoter
Created September 11, 2013 08:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shoter/6521038 to your computer and use it in GitHub Desktop.
Loading file content into buffer.
std::vector<std::string>* loadFile( std::string filename )
{
std::ifstream fileStream;
fileStream.open( filename.c_str() );
std::vector<std::string> *strings = new std::vector<std::string>();
int i = 0;
while(!fileStream.eof())
{
strings->push_back(std::string());
fileStream >> (*strings)[i++];
}
fileStream.close();
return strings;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment