#include #include #include using namespace std; int main() { string line; string word; string first; //size_t pos; float number; char c; ifstream inFile{"line.txt"}; // ifstream inFile{"ocap.txt"}; getline(inFile, line); while (inFile) { stringstream stream; stream.str(line); stream >> number; while (stream) { cout << "The number is " << number << endl; stream >> c; stream >>number; } cout <<'"'<< line <<'"' << endl; /* // you know this. // while (line.size() > 0) { pos = line.find(':'); first = line.substr(0,pos); if (pos == string::npos) { line = ""; } else { line = line.substr(pos+1); } cout << first << " and then " << line << endl; cout << stod(first) << endl; } I*/ getline(inFile, line); } return 0; }