当前位置: 代码迷 >> C语言 >> 这个小程序错在哪里?
  详细解决方案

这个小程序错在哪里?

热度:113   发布时间:2005-05-28 15:45:00.0
这个小程序错在哪里?
#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;
}
  

----------------解决方案--------------------------------------------------------
#include<dos.h>
#include<stdio.h>
int main(void)
{
struct dosdate_t d;
_dos_getdate(&d);
printf("The current year is:%d\n",d.year);
printf("The current month is:%d\n",d.month);
printf("The current day is:%d\n",d.day);
return 0;
}
应该用dos中的结构体.
----------------解决方案--------------------------------------------------------
哦 ,谢谢
----------------解决方案--------------------------------------------------------
不对,二楼改的还是不对.
   struct date d; 出了问题
----------------解决方案--------------------------------------------------------
有什么错误
可以运行!
----------------解决方案--------------------------------------------------------
你到底用的什么编译器
在tc2.0下行的呀
----------------解决方案--------------------------------------------------------
我用的C-FREE……
----------------解决方案--------------------------------------------------------
现在我改用TC2.0了,问题解决,其实以前那个程序就没有错误,谢谢各位了
----------------解决方案--------------------------------------------------------
  相关解决方案