For several days I've been trying to understand why this error occurs, but I have not found it anywhere. It is as follows, I declared a vector of the data struct and passed that vector to the function that receives it with a pointer type parameter, however, when I am going to read the data with the special operator - > gives the following error, "invalid type argument of '->', could anyone help me with this?"
Relate the item
-> '
# include stdio.h
typedef struct {
char avenida[70];
char bairro[70];
int numero;
char complemento[40];
char cidade[30];
char uf[2];
long int cep;
} Endereco;
typedef struct {
char nome[50];
int telefone[3];
Endereco endereco;
} Dados;
Dados dados[5];
void ler_dados(Dados *dados, int tamanho);
int main() {
int count;
ler_dados(dados, 5);
return 0;
}
void ler_dados(Dados *dados, int tamanho) {
int count;
for(count=0; count<tamanho; count++) {
printf("Usuário %d\n", count+1);
gets(&dados[count]->avenida);
gets(&dados[count]->bairro);
scanf("%d", &dados[count]->bairro);
gets(&dados[count]->complemento);
gets(&dados[count]->cidade);
scanf("%s" &dados[count]->uf);
scanf("%ld", &dados[count]->cep);
}
}