16 Novembre
This commit is contained in:
parent
2fe948b2ab
commit
62d68f4ceb
10
DEV1.1/TP12:Structures/date.c
Normal file
10
DEV1.1/TP12:Structures/date.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
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;
|
||||
}
|
9
DEV1.1/TP12:Structures/groupe.c
Normal file
9
DEV1.1/TP12:Structures/groupe.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <grp.h>
|
||||
|
||||
int main() {
|
||||
struct group student = getgrnam(etc/group/students22);
|
||||
printf("%s",student.gr_mem);
|
||||
return 0;
|
||||
}
|
14
DEV1.1/TP12:Structures/tailles.c
Normal file
14
DEV1.1/TP12:Structures/tailles.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct enregistrement{
|
||||
char champs1;
|
||||
char champs2;
|
||||
char champs3;
|
||||
};
|
||||
|
||||
int main() {
|
||||
struct enregistrement bob;
|
||||
printf("%d\n",sizeof bob);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user