time_t rawtime;
struct tm *mytm;
time_t result;
time(&rawtime);
mytm=localtime(&rawtime);
mytm->tm_mon=month-1;
mytm->tm_mday=day;
mytm->tm_year=year-1900;
mytm->tm_sec=0;
mytm->tm_min=0;
mytm->tm_hour=0;
result = mktime(mytm);
上面的代码片段中,我希望结果显示自1970年1月1日以来给定日期(以DD/MM/YYYY格式存储在day、month、year中)经过的秒数。但是我得到了编译错误。
错误信息为:error: dereferencing pointer to incomplete type。