passing array of pointers from one function to another
How can I pass an array of pointers? Please help... here's a piece of my code...
Code:
typedef struct node1 {
int cell;
struct node *prev;
struct node *next;
} box;
typedef struct node2 {
char name[10];
cell *move;
} player;
void play(box *tail) {
player *p[i];
int n = 5; //...n can be changed by the user..
//..more codes...
for(i = 0; i < n; i++) {
p[i] = (player *)malloc(sizeof(player));
}
p[i]->move = tail;
//..more codes...
displayBoard(tail,p[i]->move->cell, *p); //.. I will pass the array of pointers p to displayBoard
//..more codes...
}
void displayBoard(box *a, int cell, player *p){ //how can I pass p properly to this function?
//..more codes...
}