C 语言

关注公众号 jb51net

关闭
首页 > 软件编程 > C 语言 > getdate()函数

getdate()函数的用法实例

作者:

getdate()函数的用法实例,需要的朋友可以参考一下

复制代码 代码如下:

#include <stdio.h>
#include <dos.h>
int main()
{     /*getdate()函数的用法*/
    struct date d;
    getdate(&d); //获取DOS日期
    printf("the current year is:%d\n",d.da_year);//cprintf和printf用法是不同的
    printf("the current day is:%d\n",d.da_day);
    printf("the current month is:%d\n",d.da_mon);
    getch();
    return 0;
}

阅读全文