Quote Originariamente inviata da Scara95 Visualizza il messaggio
Chiami crea_modo con un carattere, non con un puntatore a caratteri. Inoltre chiami insert che prende un carattere con un puntatore a un puntatore a carattere.
Leggi i warning che ottieni come prima cosa.
codice:
struct Infof
{
    char nome[12];
    char telefono[10];
};
struct albero
{
    struct Infof info;
    struct albero *left;
    struct albero *right;
};
typedef struct albero bst;
bst *crea_nodo(char name)
{
    bst *nuovo = (bst *)malloc(sizeof(bst));
    puts(&name);
    strcpy(nuovo->info.nome, &name);
    printf("Inserisci numero di telefono: ");
    scanf("%s",nuovo->info.telefono);
    nuovo->left  = NULL;
    nuovo->right = NULL;
    return nuovo;
}
bst *insert(bst *padre, char *nom)
{
    if(padre == NULL)
    {
        return crea_nodo(nom);
    }
    if(strcmp(padre->info.nome, &nom) < 0)
    {
        return insert(padre->left, nom);
    }
    else if (strcmp(padre->info.nome, &nom) > 0)
    {
        return insert(padre->right, nom);
    }
    return padre;
}
void preorder(bst *nodo)
{
    if(nodo != NULL)
        {
            printf("Nome: %s\n", nodo->info.nome);
            printf("Numero di telefono: ");
            printf("%s",nodo->info.telefono);
            puts("");
            preorder(nodo->left);
            preorder(nodo->right);
        }
}
int main()
{
    bst *head = NULL;
    char nome[12];
    printf("Inserisci nome: ");
    gets(nome);
    head = insert(head, nome);
    short int grado;
    printf("Inserisci il grado della radice: ");
    scanf("%hi", &grado);
    grado = pow(2,grado)-2;
    short int i;
    for(i = 0; i < grado; i++)
    {
        printf("Inserisci nome: ");
        scanf("%s", &nome);
        insert(head, *nome);
    }
    preorder(head);
    return 0;
}
ci sono 3 warning ma quello interessante è :warning: passing argument 1 of 'crea_nodo' makes integer from pointer without a cast