I'm in trouble when I need to give a person value, in this case I need to give the name and age value to the person. I tried to create a struct PESSOA
and a list that contains a person and an id, but during compilation it presents / displays the image error to me.
Belowismycode:
typedefstructPESSOA{charnome[100];intidade;}Pessoa;typedefstructNO{intid;Pessoapess;structNo*prox;}No;intmain(){intcontrole;intid=0;No*no_inicial;No*no_proximo;no_inicial=(No*)malloc(sizeof(No));no_proximo=no_inicial;no_proximo->prox=NULL;while(1){printf("Insira o nome");
gets(no_proximo->pess().nome);
printf("Insira a idade");
scanf("%d", &no_proximo->pess->idade);
no_proximo->id = id;
}
}