A simple way to read a whole file into a std::string.
#include <fstream>
#include <sstream>
...
std::ifstream file( "a.txt" );
std::stringstream buffer;
buffer << file.rdbuf();
std::string content = buffer.str();
A blog about coding
A simple way to read a whole file into a std::string.
#include <fstream>
#include <sstream>
...
std::ifstream file( "a.txt" );
std::stringstream buffer;
buffer << file.rdbuf();
std::string content = buffer.str();