VC6.0的getdate()函数怎么不行?
以下这个getdate()函数是在C函数手册贴过来的,在VC6.0里编译不通过,但是贴到TC就可以成功提取日期,怎么会这样啊?错误信息已贴出,急求解决啊!谢谢各位高手
#include <dos.h>
#include <stdio.h>
int main(void)
{
struct date d;
getdate(&d);
printf("The current year is: %d\n",
d.da_year);
printf("The current day is: %d\n",
d.da_day);
printf("The current month is: %d\n",
d.da_mon);
return 0;
}
--------------------Configuration: 简单试试 - Win32 Debug--------------------
Compiling...
简单试试.c
C:\Documents and Settings\zls\桌面\C\试试而已\简单试试.c(6) : error C2079: 'd' uses undefined struct 'date'
C:\Documents and Settings\zls\桌面\C\试试而已\简单试试.c(8) : warning C4013: 'getdate' undefined; assuming extern returning int
C:\Documents and Settings\zls\桌面\C\试试而已\简单试试.c(10) : error C2224: left of '.da_year' must have struct/union type
C:\Documents and Settings\zls\桌面\C\试试而已\简单试试.c(12) : error C2224: left of '.da_day' must have struct/union type
C:\Documents and Settings\zls\桌面\C\试试而已\简单试试.c(14) : error C2224: left of '.da_mon' must have struct/union type
执行 cl.exe 时出错.
简单试试.exe - 1 error(s), 0 warning(s)