parse string
-
hy.
hab schon nach den stichwoertern parse u string gesucht, jedoch scheint das thema hier nicht aufgekommen zu sein.
ich habe folgenden code:
#include <string> #include <strstream> string inputStr; do { inputStr.clear(); double input; cin >> inputStr; stringstream parse(inputStr); parse >> input; if (parse.fail()) { cout << "string: " << inputStr << endl; } else { cout << "double: " << input << endl; alu->push(input); } } while( !(inputStr == "quit") && !cin.eof() );doch schreibt er mir, dass er stringstream net kennt.
wenn ich google nach parse u c++ findet sich kein gscheites bsp. ich will eigentich nur von whitespace zu whitespace lesen.
das ganze is natuerlich in ner methode

was hab ich da uebersehen?
tia
-
#include <sstream>
-
"using namespace std;" bzw. "std::stringstream" verwenden...
-
danke!