Looking at it, sstream is good as it parses a file by whitespace, so you could use this, and chop out the trailing comma which will be in array, yes arrays start at zero.
In that case the easiest way to do this is to:
1) Get the contents of the first array which will be X.XXXX,
2) Find the length of this string and substr the contents from start  to the [end -1]. (this should remove the comma)
3) Convert this string to a double - again using stringstreams, then store this in an array or vector.
filename has been declared using type string. stream objects need null terminated strings to associate with a file, so you need to adjust the filename by calling the c_str() method in order to open the file.
using the return value of eof() can lead to bug. If you don't try getting the first value from the file before calling eof() I'd recommend you use the approach of using the return value of the stream input method to control the loop. So instead of: