I'm basically trying to create an array of struct pointers. Each of these pointers is supposed to point to another element of the same structure array i.e BLOCKS[2].
This is what I've done so far.
typedef struct bb {
..
..
..
struct bb **successor;
} BLOCK;
BLOCK BLOCKS[10];
struct bb **A = malloc(sizeof(struct bb*)*5); //create an array of pointers of type struct bb, 5 units i.e A[0]->A[4].
BLOCKS[0].successors = A //just assigning
Now......how do I assign the first element of the pointer array, A, to another structure?
I tried:
A[0] = &BLOCKS[6];
It compiles fine but I get a seg fault.