init projet
This commit is contained in:
39
tp1/Sources-TD1/Exercice7.c
Normal file
39
tp1/Sources-TD1/Exercice7.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int x1, y1, y2, z1, z2;
|
||||
|
||||
int *px1 = &x1,
|
||||
*py1 = &y1, *py2 = &y2,
|
||||
*pz1 = &z1, *pz2 = &z2;
|
||||
|
||||
void aux(int **p, int ***q)
|
||||
{
|
||||
**p = 2;
|
||||
***q = 99;
|
||||
*p = pz1;
|
||||
**p = 12;
|
||||
p = &py2;
|
||||
*q = &px1;
|
||||
**p = 4;
|
||||
***q = 42;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int **p, **q, ***r, s, *t;
|
||||
p = &py1;
|
||||
q = &px1;
|
||||
r = &q;
|
||||
*p = &s;
|
||||
**q = 1;
|
||||
**p = 34;
|
||||
***r = 76;
|
||||
t = **r;
|
||||
r = &p;
|
||||
|
||||
aux(p, &q);
|
||||
printf("%d %d %d %d %d \n",
|
||||
**q, **p, ***r, s, *t);
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user