A usage instance of the getdate of function

  • 2020-04-01 21:32:35
  • OfStack


#include <stdio.h>
#include <dos.h>
int main()
{     
    struct date d;
    getdate(&d); //Get DOS date
    printf("the current year is:%dn",d.da_year);//The usage of cprintf and printf is different
    printf("the current day is:%dn",d.da_day);
    printf("the current month is:%dn",d.da_mon);
    getch();
    return 0;
}


Related articles: