Input from File

A question: I have a file containing sequences of numbers, looking something like this:

34.45 55.0
24.5 78.6
28.55 98.8

etc.

I need to be able to extract the numbers and use them as numbers.
Do I have to extract them as char or as binary?

If I extract them with char, how do I convert them to floats?
If I extract them as Binary,what do i get exactly?

thanks in advance for any help!
You can use >> operator to get data from file:
1
2
3
4
5
6
7
8
9

  fstream file("file.txt"); // open file

  while(file.good()) // loop until EOF is not reached
    {
        float num;
        file >>num; // get number from file
        cout <<num<<endl;
    }
Topic archived. No new replies allowed.