My code like this:
std::istringstream file("res/date.json");
std::ostringstream tmp;
tmp<<file.rdbuf();
std::string s = tmp.str();
std::cout<<s<<std::endl;
The output is res/date.json, while what I really want is the whole content of this json file.
This
creates a stream (named
file) that reads from the string"res/date.json".This
creates a stream (named
file) that reads from the file namedres/date.json.See the difference?