0

Hey guys i need some help. I have a txt file which looks like this:
234 56 123 34 456 56 7 45.....
123 3 34 56 56 67 67 2.....
.
.
.
Where each line represents a series of points in coordinate system, and the first number in each line represents the x-point, second y-point,third x-point and so on. I need to read the file, and store the data. I would like to store it in a structure:
struct path {

int x();
int y();
};
I would also need some kind of automatic variable naming for struct path, so when i begin to store second line of points i would have struct name path2. These are just my ideas, so if you can, please help with every approach you can think of. And when the data storing is done i should be able to know the total number of paths and total number of point pairs (x,y) for every path. If you have any ideas please help, i'm a begginer and really need to solve this problem. Thank you in advance!!

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Tigran
0

>I would also need some kind of automatic variable naming for struct path, so when i begin to store second line of points i would have struct name path2.

I don't quite get why you need to differentiate between the separate lines.

It makes your code slightly more difficult

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.