Hello I have this struct below :

```
typedef struct GRAPHE{
        int n;    /* Nombre de sommets */
        int **M;  /* Matrice d'Adjacence */
    } GRAPHE; 

```

I need to allocate memory ,I tried this function but it doesn't seem to work

```
void reservation_en_memoire(int n, GRAPHE *g) {
    int i, j;
    g = (GRAPHE *) malloc(n * sizeof (struct GRAPHE));
    g->M = (int **) malloc(n * sizeof (int*));
    for (i = 0; i < n; i++)
        g->M[i][j] = (int) malloc(n * sizeof (int));

    g->n = n;

}

```

And in the main I'm just doing like this :

```
int main(int argc, char** argv) {

    GRAPHE *g;
    reservation_en_memoire(3, g);
    printf("%d", g->n);
    //  printf("%d", g->M[0][0]);

    return (EXIT_SUCCESS);
}

```

Can you please give me a little help here please !!