I have a function that reads through an istringstream
and does some operations on it so ... I am trying to read in a file using fstream
and convert the fstream
object to an istringstream
in order to pass it to my function. I don't know how to do this. Any help would be much appreciated. I am still pretty much a beginner so please keep it simple if you can.
string inputFile(argv[1]);
ifstream inFile(inputFile.c_str());
istringstream is;
is >> inFile.rdbuf(); //*******This is wrong and is what I'm having trouble with
function(is);