I defined a structure called coordonnees declared as a pointer, I want to append values to the pointer a_visiter but it's not working. How can I fix that?
Here is the struct code:
typedef struct couple
{
int ligne;
int colonne;
}*coordonnees;
int main()
{
coordonnees a_visiter;
a_visiter=(coordonnees)malloc(DIMENSION*4*sizeof(struct couple));
int p=0;
etc ...
}
void voisin_egaux(char matrice[][DIMENSION+1],int x, int y,coordonnees **a_visiter,int *p)
{
if (matrice[x][y]==matrice[x+1][y]){
(a_visiter+(*p))->ligne=x+1;
(a_visiter+(*p))->colonne=y;
++(*p);
}
I get as an error: request for member ligne in something not a structure or union.