From 62d68f4ceb706c8aed58171a5829f86a12cf6c89 Mon Sep 17 00:00:00 2001 From: pourchot Date: Wed, 16 Nov 2022 15:31:49 +0100 Subject: [PATCH] 16 Novembre --- DEV1.1/TP12:Structures/date.c | 10 ++++++++++ DEV1.1/TP12:Structures/groupe.c | 9 +++++++++ DEV1.1/TP12:Structures/tailles.c | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 DEV1.1/TP12:Structures/date.c create mode 100644 DEV1.1/TP12:Structures/groupe.c create mode 100644 DEV1.1/TP12:Structures/tailles.c diff --git a/DEV1.1/TP12:Structures/date.c b/DEV1.1/TP12:Structures/date.c new file mode 100644 index 0000000..404d5d2 --- /dev/null +++ b/DEV1.1/TP12:Structures/date.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main() { + time_t ts=time(NULL); + struct tm* date = localtime (&ts); + printf("Nous sommes le %d/%d/%d.\n",date->tm_year+1900,date->tm_mon,date->tm_hour); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP12:Structures/groupe.c b/DEV1.1/TP12:Structures/groupe.c new file mode 100644 index 0000000..666f33e --- /dev/null +++ b/DEV1.1/TP12:Structures/groupe.c @@ -0,0 +1,9 @@ +#include +#include +#include + +int main() { + struct group student = getgrnam(etc/group/students22); + printf("%s",student.gr_mem); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP12:Structures/tailles.c b/DEV1.1/TP12:Structures/tailles.c new file mode 100644 index 0000000..8c2f090 --- /dev/null +++ b/DEV1.1/TP12:Structures/tailles.c @@ -0,0 +1,14 @@ +#include +#include + +struct enregistrement{ + char champs1; + char champs2; + char champs3; +}; + +int main() { + struct enregistrement bob; + printf("%d\n",sizeof bob); +return 0; +} \ No newline at end of file