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 39 of file doy2day.c.
41 {
42
43 int day, mon;
44
45
47
48
49 if (argc < 3)
50 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
51 "Usage: doy2day <year> <doy>\n\n" "Use -h for full help.");
52
53
54 const int year = atoi(argv[1]);
55 const int doy = atoi(argv[2]);
56
57
59 printf("%d %d %d\n", year, mon, day);
60
61 return EXIT_SUCCESS;
62}
void doy2day(int year, int doy, int *mon, int *day)
Convert a day-of-year value to a calendar date.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.