So im currently trying to do the following
void testLibrary() {
tBook book_1;
book_1.author[MAX_STRING_LEN] = "Alvaro";
book_1.id = 1;
book_1.title[MAX_STRING_LEN] = "Prueba A";
printf("%s", book_1.title);
}
But I wont get "Prueba A" on the console oputput. same goes if I try with book_1.author or with %d and book_1.id
Heres my tBook struct
#define MAX_STRING_LEN 100
typedef struct {
char author[MAX_STRING_LEN];
char title[MAX_STRING_LEN];
int id;
} tBook;
Not sure why is it not working... maybe on C you initialize structs in a different way?