关于时间的函数
struct date_t{
int year;
int month;
int day;
};
struct date_t gets_system_date()
{
time_t rawtime;
struct tm * timeinfo;
struct date_t *s;
time(&rawtime);
timeinfo = localtime(&rawtime);
timeinfo->tm_year=timeinfo->tm_year + 1900;
timeinfo->tm_mon=timeinfo->tm_mon+1;
timeinfo->tm_mday;
system("pause");
s=timeinfo;\*这一行显示warning C4133: '=' : incompatible types - from 'struct tm *' to 'struct date_t *'*\
return *s;
}
我想要返回的是date_t类型的数据,怎么办?