I am trying to print this out but it keeps failing, and prints the just the address, I"m new to C and not quite sure how to fix this.
I have two struct and two methods,
struct Date {
char week_day[30];
int day[31];
int month[12];
};
struct Holiday {
char name[80]; //name
struct Date date; //date
};
void printHols(struct Holiday hol[]){
printf("Holidays in 2018\n");
for (int i=0; i<2; i++) {
printf("%d / %d \t - %s \t - %s", hol[i].date.day, hol[i].date.month, hol[i].date.week_day, hol[i].name);
}
}
void holidaysValues(){
struct Holiday holiday={{"New Year",{"Monday",1,1}}, {"Some Holiday",{"Tuesday",2,3}} };
//passing this struct below doesn't work as expected, prints addresses of how[I].date.day, hol[I].date.month
printHols(&holiday);
}
All suggestions are welcome. Thanks