Hat einer eine Idee...

bluescreen
Ich möchte ein Programm schreiben das daten(aus einer Textdatei einließt) Zeilenweiße einließt.
Hätte jemand einen Vorschlag wie man die daten einließt und in einzelne strings zerlegt in einer schleife
Die Textdatei ist wie folgt aufgebeut:
ersterString zweiterString dritterString
ersterString zweiterString dritterString
ersterString zweiterString dritterString
.
.
.
.


einer ne idee?
Hanfling
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
#include <vector>
#include <string>
#include <sstream>

using namespace std;

int main()
{
    string str("Split me by whitespaces");
    string buf; // Have a buffer string
    stringstream ss(str); // Insert the string into a stream

    vector<string> tokens; // Create vector to hold our words

    while (ss >> buf)
        tokens.push_back(buf);
}

Gefunden auf:
http://www.oopweb.com/CPP/Documents/CPPH...ng-HOWTO-7.html