Given a text file with a semi-known format. Total characters in 1 line will be less than 1000. Zinteger is just a normal integer but it serves a different purpose. String terminated via space.
String ZInteger Integer Integer
String ZInteger Integer Integer Integer Integer
So its a word followed by a number followed by pairs of numbers, but a random amount of pairs.
I want to store the string , Zinteger, and integer pairs for each line in a data structure.
So I tried an array where A[1] would be a struct that has String, Zinteger and the pairs of integers which will be another struct that has the integer pair. Heres what i tried.
typedef struct {
int num1;
int num2;
} ints_t;
typedef struct {
char term[1000];
int quantity(bad variable name, could be called alpha);
ints_t *pairs;
} info_t;
Help is appreciated.
EDIT: Alright so im being too open. So ill just ask a simple question are the two structs I made viable and if not how do I make them viable and how do I malloc the structs and array.
Zintegerwouldn't happen to be the number of following integers (or pairs of integers) would it?