Negative_creep
21-11-2007, 15:54
Ciao a tutti, non riesco a capire perchè mi dà errore quando tento di accedere ad un campo della struct:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char name[10];
typedef struct studente{
int matricola;
char nome[10];
char cognome[10];
} a ;
printf("Inserisci il nome dello studente: ");
scanf("%s",name);
a.nome = name; /*L'errore è qui */
}
Sapreste aiutarmi?
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char name[10];
typedef struct studente{
int matricola;
char nome[10];
char cognome[10];
} a ;
printf("Inserisci il nome dello studente: ");
scanf("%s",name);
a.nome = name; /*L'errore è qui */
}
Sapreste aiutarmi?