In struct "saf" i have the array "stack" and in struct "data" i have "pinx" which is the array of struct "data" . I want to the array "stack" to have as members the "pinx" array, but i don't know how can i have access from stack array to the members of pinx. I provide you an image so you will understand what i want to do.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct saf
{
int head;
void **stack;
int size;
}exp1;
struct data
{
int flag;
char name[50];
};
struct data *pinx;
void init(int n)
{
pinx = malloc(sizeof(struct data) * n);
exp1.stack = malloc(n);
}
void add()
{
strcpy(pinx[0].name,"name");
pinx[0].flag=0;
exp1.stack[0]=&pinx[0];
}
int main()
{
printf("Give size: ");
scanf("%d",&exp1.size);
init(exp1.size);
add();
return 0;
}
exp1.stack = malloc(n);is probably an error, I think you meantexp1.stack = malloc(n * sizeof *exp1.stack), which will let you havenpointers in that array.