S
Steve Chow
I have two structures;
struct cordsys {
int y, x, length
};
struct provinces {
int number;
int type;
struct cordsys cord;
};
and a file that looks like:
1
68 78 83
69 78 87
70 78 89
71 78 91
72 78 93
73 77 95
1
2
110 77 180
111 77 182
112 77 184
113 76 186
114 76 188
115 76 189
116 76 191
117 76 192
2
.................
what i need to do is read the beginning number into provinces.number.
and read the next rows. with three numbers each. read into
provinces.cords.y provinces.cord.x provinces.cord.length
creating a new cord array (while keeping the old one) with each row.
when it hits a number that matches the beginning cord. i need it to add
a new province array (while keeping the old one)
i'm new to c so know nothing about memory management. not asking anyone
to do my work also. just need a detailed explanation of the concepts,
possibly functions, and a general idea. think who/what/where/why. thank
you.
struct cordsys {
int y, x, length
};
struct provinces {
int number;
int type;
struct cordsys cord;
};
and a file that looks like:
1
68 78 83
69 78 87
70 78 89
71 78 91
72 78 93
73 77 95
1
2
110 77 180
111 77 182
112 77 184
113 76 186
114 76 188
115 76 189
116 76 191
117 76 192
2
.................
what i need to do is read the beginning number into provinces.number.
and read the next rows. with three numbers each. read into
provinces.cords.y provinces.cord.x provinces.cord.length
creating a new cord array (while keeping the old one) with each row.
when it hits a number that matches the beginning cord. i need it to add
a new province array (while keeping the old one)
i'm new to c so know nothing about memory management. not asking anyone
to do my work also. just need a detailed explanation of the concepts,
possibly functions, and a general idea. think who/what/where/why. thank
you.