another way to read a file in a string :
std::string read(const std::string& filename)
{
std::ifstream ifs(filename.c_str());
typedef std::istreambuf_iterator<char> charStreamBuf_iter;
return std::string(charStreamBuf_iter(ifs.rdbuf()), charStreamBuf_iter());