Multiple Inputs from DAT file

Hello Everyone....i am having a small problem in c++.I have to take input from a DAT file which contains say 50 values of x, 50 values of y, 50 values of z etc.i.e i have to take multiple inputs from the file into different variables...Can someone here help me do that?
I assume that each x, y and z is in 1 row like this:
1
2
3
1 2 3
4 5 6
.....


Open a file with ifstream
std::ifstream a("filename");
Read from it
a >> var1 >> var2; // and so on...

Hard?
You continue until all data is taken....
Last edited on
Topic archived. No new replies allowed.