update
This commit is contained in:
BIN
DEV/DEV1.1/TP_adresses/exe
Executable file
BIN
DEV/DEV1.1/TP_adresses/exe
Executable file
Binary file not shown.
20
DEV/DEV1.1/TP_adresses/q1.c
Normal file
20
DEV/DEV1.1/TP_adresses/q1.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
float decimal;
|
||||
double decimalPrecisise;
|
||||
long double grandDecimal;
|
||||
char caracter;
|
||||
short int petitEntier;
|
||||
int entier;
|
||||
long long unsigned int megaNaturel;
|
||||
printf("%p\n",&decimal);
|
||||
printf("%p\n",&decimalPrecisise);
|
||||
printf("%p\n",&grandDecimal);
|
||||
printf("%p\n",&caracter);
|
||||
printf("%p\n",&petitEntier);
|
||||
printf("%p\n",&entier);
|
||||
printf("%p\n",&megaNaturel);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
0
DEV/DEV1.1/TP_adresses/q1.c~
Normal file
0
DEV/DEV1.1/TP_adresses/q1.c~
Normal file
13
DEV/DEV1.1/TP_adresses/q2.c
Normal file
13
DEV/DEV1.1/TP_adresses/q2.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
int main(void) {
|
||||
char min, maj;
|
||||
char *p = NULL;
|
||||
|
||||
for(min = 'a', maj = 'A'; maj <= 'Z'; min++, maj++) {
|
||||
p = (p == &min) ? &maj : &min;
|
||||
putchar(*p);
|
||||
}
|
||||
putchar('\n');
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
0
DEV/DEV1.1/TP_adresses/q2.c~
Normal file
0
DEV/DEV1.1/TP_adresses/q2.c~
Normal file
19
DEV/DEV1.1/TP_adresses/q3.c
Normal file
19
DEV/DEV1.1/TP_adresses/q3.c
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
int main(void) {
|
||||
int* p;
|
||||
|
||||
if(time(NULL)%2) {
|
||||
int x = 59;
|
||||
p = &x;
|
||||
printf("x=%d\n", x);
|
||||
} else {
|
||||
int y = 31;
|
||||
p = &y;
|
||||
printf("y=%d\n", y);
|
||||
}
|
||||
printf("%d\n", *p);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
0
DEV/DEV1.1/TP_adresses/q3.c~
Normal file
0
DEV/DEV1.1/TP_adresses/q3.c~
Normal file
15
DEV/DEV1.1/TP_adresses/q4.c
Normal file
15
DEV/DEV1.1/TP_adresses/q4.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
long long int n1 = 4614256656552045848LL;
|
||||
double* p1 = (double*) &n1;
|
||||
double n2 = *p1;
|
||||
n2 = n2*2;
|
||||
long long int* p2 = (long long int*) &n2;
|
||||
long long int n3 = *p2;
|
||||
double* p3 = (double*) &n3;
|
||||
printf("π = %f\n", *p3);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
//4614256656552045848LL
|
||||
10
DEV/DEV1.1/TP_adresses/q4.c~
Normal file
10
DEV/DEV1.1/TP_adresses/q4.c~
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
long long int n = 4614256656552045848LL;
|
||||
double* p = (double*) &n;
|
||||
printf("π = %f\n", *p);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
//4614256656552045848LL
|
||||
31
DEV/DEV1.1/TP_adresses/q5.c
Normal file
31
DEV/DEV1.1/TP_adresses/q5.c
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
int main(void) {
|
||||
int a = 1, b = 2, c = 3;
|
||||
int *p, *q;
|
||||
printf(" a b c*p*q\n");
|
||||
printf("1) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
p=&a;
|
||||
printf("2) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
q=&c;
|
||||
printf("3) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
*p=(*q)++;
|
||||
printf("4) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
p=q;
|
||||
printf("5) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
q=&b;
|
||||
printf("6) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
*p-=*q;
|
||||
printf("7) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
++*q;
|
||||
printf("8) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
*p*=*q;
|
||||
printf("9) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
a=++*q**p;
|
||||
printf("10) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
p=&a;
|
||||
printf("11) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
*q=*p/(*q);
|
||||
printf("12) %d,%d,%d,%d,%d\n",a,b,c,*p,*p);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
0
DEV/DEV1.1/TP_adresses/q5.c~
Normal file
0
DEV/DEV1.1/TP_adresses/q5.c~
Normal file
Reference in New Issue
Block a user