commit 244151ff0e55de56189643696af4b927ed5654eb Author: Lukian Date: Sun Nov 12 14:01:37 2023 +0100 commit diff --git a/conf.c b/conf.c new file mode 100644 index 0000000..4c2891c --- /dev/null +++ b/conf.c @@ -0,0 +1,18 @@ +#include +#include +#include +#include "conf.h" + +ptDate newDate(int day, int month, int year) { + ptDate date = (ptDate) malloc(sizeof(ptDate)); + + date -> day = day; + date -> month = month; + date -> year = year; + + return date; +} + +void printDate(ptDate date) { + printf("%d/%d/%d\n", date -> day, date -> month, date -> year); +} \ No newline at end of file diff --git a/conf.h b/conf.h new file mode 100644 index 0000000..ef572af --- /dev/null +++ b/conf.h @@ -0,0 +1,24 @@ +#ifndef CONF_H +#define CONF_H + +typedef struct date { + int day; + int month; + int year; +} tDate; + +typedef struct conf { + tDate date; + char title[30]; + char speaker[20]; + struct tConf* next; +} tConf; + +typedef tDate* ptDate; +typedef tConf* ptConf; + +ptDate newDate(int day, int month, int year); + +void printDate(ptDate date); + +#endif // CONF_H \ No newline at end of file diff --git a/main b/main new file mode 100644 index 0000000..81ad83d Binary files /dev/null and b/main differ diff --git a/main.c b/main.c new file mode 100644 index 0000000..90697d9 --- /dev/null +++ b/main.c @@ -0,0 +1,12 @@ +#include +#include +#include "conf.h" + +int main() +{ + ptDate date = newDate(12,12,2023); + + printDate(date); + + return 0; +} \ No newline at end of file