// define structure
typedefstruct {
int day;
int month;
int year;
} Date;
//function defn
void dateFunction (Date *num);
//main function
main ()
{
Date date;
dateFunction(&date);
}
//date function
void dateFunction (Date *num)
{
num.day = 1;
num.month = 1;
num.year = 1;
}
My problem is i have some repetitive tasks that i'd like to use a function for, but can't seem to get the syntax right. I get the following compiler error for all 3 initializations:
"request for member ‘day’ in ‘date’, which is of non-class type ‘Date*’"