4
I need to dynamically allocate space for a structure, but I am not able and I do not know my error is at the time of the statement or allocation, follow the functions consistent with the statement.
Statement
struct {
    char nome[100];
    char rua[100];
    char cidade[100];
    char estado[100];
    unsigned long int cep;
} dados;
Allocation
void cria_lista(void) {
    dados info;
    info = malloc(sizeof(struct info));
}
Relocation
void insere(void) {
    int aux;
    int posicao;
    posicao = livre();
    if (posicao == -1) {
        printf("\nEstrutura Cheia!!");
        return;
    }
    if (posicao != 0){
        info = realloc(info,1);
    }
    printf("-- Registro %d:\n", posicao);
    printf("\t Nome: ");
    ler_string(busca.nome, 30);
    aux = busca_nome();
    if (aux != 0)
        strcpy(info[posicao].nome, busca.nome);
    printf("\t Rua: ");
    ler_string(info[posicao].rua, 40);
    printf("\t Cidade: ");
    ler_string(info[posicao].cidade, 20);
    printf("\t Estado: ");
    ler_string(info[posicao].estado, 2);
    printf("\t CEP: ");
    scanf("%lu", &info[posicao].cep);
}
						
What and where is the error?
– Maniero