帮忙看看,这个错怎么改,谢谢!
程序代码:
typedef struct { int year, month, day; } Date; Date* CreateDate(int year, int month, int day){ Date *date = (Date*)malloc(sizeof(Date)); date->year=year; date->month=month; date->day=day; return date; } void DestroyDate(Date** p){ free(*p); *p = NULL; } Date* CopyDate(const Date* date){ Date *a; a = (Date *) malloc(sizeof(Date)); *a = *date; return a; } int GetYear(const Date* date){ return date->year; } void SetYear(Date* date, int year){ date->year=year; } void SetDate(Date* date, int year, int month, int day){ date->year=year; date->month=month; date->day=day; }