I have an array struct that is inside another struct, but I don't know how to print the value of the son struct in a function.
The main struct is something like:
struct person{
char name[10];
int cash;
listMov mov[];
};
typedef person Person;
Person user[50];
And the son struct
struct listaMovimenti{
int bonifico;
char beneficiario[10];
};
typedef struct listaMovimenti listMov;
listMov mov[2] = {{150, "Ponzi" },
{2000, "Gotti"}};
I've tried with something like this but with no success.
printf("Name %s and %d",user[0].mov[1].beneficiario, user[0].mov[1].bonifico);
usertoousername and cash through a simplyscanf.usermov? It's different to themovvariable you've included code for