part lines from file into an array

From: Edo (eddod_at_eddododod.dod)
Date: 09/30/04


Date: Thu, 30 Sep 2004 03:09:40 -0700

Hello

I have a .txt file with <space>-delimited data on each line.
Number of <space>s is 11 so there is 12 <double> numbers in each line.
I need to get from the 2nd to the 11th number into an double array[10],
I did this code below but I must be screwing up something because the
second while condition never evaluates to true.

ifstream fin("path-to-file");
unsigned ling id;
double xyz[10];
double x;
string line;
while( getline(fin, line) ){
        istringstream is;
        is >> line;
        int i = 0;
        while( is >> x ){
                id = static_cast<unsigned long> (x);
                ++i;
                if( i==1 && i <= 10 ){ xyz[i-1] = x; }
        }
        is.clear();
        if(! fin.good() ) continue;
}

Thanks