struct date{
int date;
int month;
int year
};
struct date current_date;
I have this struct. Then I wanna store the current date in current_date. How can I do this using C language?
Thank You so much!
struct date{
int date;
int month;
int year
};
struct date current_date;
I have this struct. Then I wanna store the current date in current_date. How can I do this using C language?
Thank You so much!
Hello in this source: https://www.geeksforgeeks.org/getdate-and-setdate-function-in-c-with-examples/
It says that getdate() function might be useful to you. It works like this:
struct date yourdate;
getdate(&yourdate);
current_date.day = yourdate.da_day
And you should import #include <dos.h>
struct tm is a very standard structure for representing a broken down time representation with second resolution.
You would: