S
Steve Chow
rough example I have two structs
typedef struct
{
int yaxis;
int xaxis;
int length;
}Cords;
typedef struct
{
int number;
char type;
Cords *cords;
}Province;
I have a file that looks like
1 //Should be read into Province.number
20 40 80 //Should be read into Province.Cords.yaxis xaxis and length
respectively
21 39 80
.......
9 // 9 Terminates
2
50 80 20
.......
9
So basically, I need a way of pouring an unknown amount of blocks that
terminate with 9 from a file, into an unknown amount of Province
structures, when it gets to the sole #9 it should move onto another
Province structure.. ideas? (or better ideas to indicate that it should
move onto another structure?)
examples please.
typedef struct
{
int yaxis;
int xaxis;
int length;
}Cords;
typedef struct
{
int number;
char type;
Cords *cords;
}Province;
I have a file that looks like
1 //Should be read into Province.number
20 40 80 //Should be read into Province.Cords.yaxis xaxis and length
respectively
21 39 80
.......
9 // 9 Terminates
2
50 80 20
.......
9
So basically, I need a way of pouring an unknown amount of blocks that
terminate with 9 from a file, into an unknown amount of Province
structures, when it gets to the sole #9 it should move onto another
Province structure.. ideas? (or better ideas to indicate that it should
move onto another structure?)
examples please.