Convert day of year to date.
More...
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Convert day of year to date.
Definition in file doy2day.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 27 of file doy2day.c.
29 {
30
31
32 if (argc < 3)
33 ERRMSG(
"Give parameters: <year> <doy>");
34
35
36 int year = atoi(argv[1]);
37 int doy = atoi(argv[2]);
38
39
40 int day, mon;
42 printf("%d %d %d\n", year, mon, day);
43
44 return EXIT_SUCCESS;
45}
void doy2day(const int year, const int doy, int *mon, int *day)
Converts a given day of the year (DOY) to a date (month and day).
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.