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