Putting Values in Text File into a Program.

Hey Guys,

I have a text file which contains a single line.

"100 200 300"

In my program I have three ints.

int x;
int y;
int z;

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ifstream is;

is.open("graphic.txt", ios::in);
if(is.is_open())
{
    while(!is.eof())
    {
    /*What this does. It reads in the values in readFile and puts them into     temp line by line. */

    getline(readFile,temp);

    }//End while

    is.close();
}


How do I insert these three values in my text file into x, y and z in my program ?

How do I get the location of each string ( 100 , 200 and 300 ) and how do I parse them to ints ?

Any help would be great! Thanks.
Topic archived. No new replies allowed.