commit
This commit is contained in:
commit
244151ff0e
4 changed files with 54 additions and 0 deletions
18
conf.c
Normal file
18
conf.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#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);
|
||||
}
|
24
conf.h
Normal file
24
conf.h
Normal file
|
@ -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
|
BIN
main
Normal file
BIN
main
Normal file
Binary file not shown.
12
main.c
Normal file
12
main.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "conf.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
ptDate date = newDate(12,12,2023);
|
||||
|
||||
printDate(date);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue