Hey guys I'm having trouble figuring this out.

I'm use fstream to open the file...

Now how can I get my program to read data from the file and store them into variables?

Code:
 
for (;;)
  {
    fstream filestr;

    filestr.open (File);


    // Skip leading white space
    double G = 0, H = 0, L, Item;

//PROBLEM STARTS HERE
    cin >> ws;

    if (cin.eof()) break;

    // Look ahead at next character in the input stream (without consuming it)

    if ( isdigit( cin.peek() ) )
    {
      // Next character was a numeric digit, so input a real number

      cin >> D;
      cout << "Number: " << D << endl;
I'm using Linux right now, a.out < filename works just fine.
But I have to use this format: a.out filename filename2 filename3.

Do I even use cin?

Thank you.