I can't understand how I can initialize a char array in an array struct. I have written this code:
typedef struct tomo
{
char titolo[100];
char autore[100];
int anno_pubblicazione;
float prezzo;
} t_libro;
main(){
t_libro biblio[2];
biblio[0] = {"Guida al C", "Fabrizio Ciacchi", 2003, 45.2};
biblio[1] = {"Harry Potter e la Pietra Filosofale", "J.K.Rowling", 2003, 12.5};
}
but when i compile, it says me that before '{' an expression is expected. How i can solve it? These char arrays give me a lot of problems...
P.S. Ive tried also to use
biblio[0].titolo = "Guida al C";
and in this manner for the other fields of struct, but also in this manner I have an error.