Hi,
I'm still stock on the last phase!
Mats, I am supposed to do it jus the way I explained it to u! each cell havin the list of all cells to which it is related!
I have a snippet of my prog for which I'm getting an error and can't seem to know why! (I'm having problems using linked list)
u know I had a struct for each cell that now looks like this:
Code:
struct cell{
float content;
int isValid;
char *formula;
relative *list;
};
the last variable is the list of relative cells and its of this type(its a node of the list):
Code:
struct relative{
relative *next;
Address adrs;
};
and again the last variable of this one is of this type:
Code:
struct Address{
int row
int col;
};
so when I get a formula for say A1(first of all I track to see where A1 is, so I get row=1 and col=1 for A1), like A1= 2* B3 +1 - B4...etc, I'm going thru everything after equal sign and then whenever I see a cell address like B3 in here, I follow the same process of getting the row and col num of B3 and store them in two variables like in here crow4=3, and ccol4=2 for B3.
and then I want this info to be part of a new node of the list of relatives, so I do this:
Code:
table[row][col].list= (relative*)malloc(sizeof(relative));
to create a new node of type relative for that specific cell being A1 here in order to store info about its first relative, B3. then:
Code:
table[row][col].list.adrs.row= crow4;
table[row][col].list.adrs.col= ccol4;
but I'm getting an error when compiling: "Structure required on the left side of . or .* "
plz help me out!