Jak pobrac rok z daty systemowej?

0

Jutro mam poprawke egzaminu z C++ i nie umiem pobrac daty systemowej dokladnie roku.
Napisalem cos takiego ale powinno pobierac rok z daty systemowej.

#include <stdio.h>
#include <dos.h>
#include <iostream.h>
bool typ_Is_Leap_Year(int year);

int main(int argc, char *argv[])
{
char ch[5];
cout<<"The year "<<y2000<<" is leap year:"<<typ_Is_Leap_Year(y2000)<<endl;
cout<<"The year "<<y2003<<" is leap year:"<<typ_Is_Leap_Year(y2003)<<endl;
cout<<"The year "<<y2004<<" is leap year:"<<typ_Is_Leap_Year(y2004)<<endl;
int stop;
cin>>stop;
  return 0;
}
bool typ_Is_Leap_Year(int year)
{
char ch[5];
if ((year%4==0) || (year%400==0 && year % 100!=0))
return true;
else
return false;
}

Jak to mozna zrobic???</cpp>

0

a helpa to kozystac umie???

#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;
}

i w zmiennej d.da_year masz rok...

0

czytalem na googlach. Cos takiego zrobilem ale w kompilatorze dev-c++ w linijce struct date d wyskakuje blad:
aggregate `struct date d' has incomplete type and cannot be initialized
Pewnie cos zle robie. Ale co???
DZieki za poprzednia odpowiedz i bylbym wdzieczny za kolejna.

1 użytkowników online, w tym zalogowanych: 0, gości: 1