22 lines
673 B
C
22 lines
673 B
C
|
#include<stdio.h>
|
||
|
#include<stdlib.h>
|
||
|
|
||
|
int main(int argc, char * argv[]) {
|
||
|
int a = 1, b = 2, c = 3;
|
||
|
int *p, *q;
|
||
|
|
||
|
// -> veut dire "pointe vers" donc p -> a veut dire p pointe vers a.
|
||
|
|
||
|
p=&a; // a = 1 b = 2 c = 3 ; p -> a ; q -> NULL
|
||
|
q=&c; // a = 1 b = 2 c = 3 ; p -> a ; q -> c
|
||
|
*p=(*q)++; // a = 3 b = 2 c = 4 ; p -> a ; q -> c
|
||
|
q=&b; // a = 3 b = 2 c = 4 ; p -> a ; q -> b
|
||
|
*p-=*q; // a = 1 b = 2 c = 4 ; p -> a ; q -> b
|
||
|
*p*=*q; // a = 2 b = 2 c = 4 ; p -> a ; q -> b
|
||
|
a=++*q**p; // a = 6 b = 3 c = 4; p -> a ; q -> b
|
||
|
p=&a; // a = 6 b = 3 c = 4; p -> a ; q -> b
|
||
|
*q=*p/(*q); // a = 6 b = 2 c = 4; p -> a ; q -> b
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|
||
|
|