getdate 未定义标识符,该加的头文件都加了啊,还是说我缺少什么文件。用的VS2010

#include<stdio.h>
#include<stdlib.h>
#include <dos.h>
#include<windows.h>
struct date
{
int year;
int month;
int day;
};
struct time
{
int hour;
int minute;
int second;
};
int main()
{
struct date d;
struct time t;
getdate(&d);
gettime(&t);
printf("the current day is:%d--%d--%d",d.year,d.month,d.day);
printf("the current time is:%d--%d--%d",t.hour,t.minute,t.second);
system("pause");
return 0;
}

在VC++6.0中运行程序不能通过,原因是此版本的<dos.h>中不包含getdate函数。
但在TroboC 中运行可以通过。追问

我想使用这个函数的话该怎么做呢?

追答

要么换个编译器,要么自己写一个getdate的函数。

温馨提示:答案为网友推荐,仅供参考

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网