0
Good evening! I am learning to program in c and I have a problem, someone can help me?
typedef struct utente //Armazena o nome, número de utente, data de nascimento de um utente, assim como se se trata de um utente de rsico ou não
{
int num;
char nome[27];
char nascimento[11];
char risco;
} utente_tipo;
typedef struct concelho //Armazena o nome, código e número de habitantes de um concelho
{
char nome[30];
int code;
int habitantes;
} concelho_tipo;
typedef struct rastreio
{
utente_tipo utente;
concelho_tipo concelho;
char data[11];
char teste;
char sintomas[40];
} rastreio_tipo;
How should I store and access data from the tracking structure?
I don’t know if I understood your doubt, it would be something like
rastreio_tipo.utente.num
orrastreio_tipo.concelho.habitantes
?– anonimo
Exactly, my doubt is exactly how I articulate the three structures, that is, how to access the data inhabitants, risk and so of the user structure_type and concelho_type through trace_type
– Érica
So I understand each instance of
rastreio_tipo
should have multipleconcelho
s andutente
s associated, but its statement only associates oneconcelho
and autente
torastreio_tipo
.– anonimo
Can you explain it better please? I don’t understand why it has to be like this...
– Érica