char* test(char* path) {
ifstream f(string(path));
string str(istreambuf_iterator<char>(f), istreambuf_iterator<char>());
return str.c_str();
}
This code cannot be compiled at visual studio 2012.
Error is
error C2228: left of '.c_str' must have class/struct/union
What is the problem? Any suggestion?