forked from Danielbet21/Amusement_Park
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDate.h
34 lines (30 loc) · 883 Bytes
/
Date.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __MYDATE__
#define __MYDATE__
#include <crtdbg.h> // TODO: remove before release
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "General.h"
#include "fileHelper.h"
#define MIN_YEAR 2024
typedef struct
{
int day;
int month;
int year;
}Date;
// functions
int initDate(Date* pDate, int day, int month, int year);
int isDateValid(int day, int month, int year);
int isDayValid(int day, int month);
void printDate(const Date* pDate);
int compareDates(const Date Date1, const Date Date2);
//int saveDateToBinFile(FILE* file, Date* pDate);
//Date readDateFromBinFile(FILE* file);
void initDateByUser(Date* pDate);
// save and load function
int saveDateToTextFile(const Date* pDate, FILE* fp);
int loadDateFromTextFile(Date* pDate, FILE* fp);
int saveDateToBinFile(const Date* pDate, FILE* fp);
int loadDateFromBinFile(Date* pDate, FILE* fp);
#endif