Add inversion-variables

This commit is contained in:
flyingscorpio@pinebookpro 2021-11-15 10:32:16 +01:00
parent 1822496295
commit f345891be9

View file

@ -0,0 +1,21 @@
/* Inversion de variables */
#include <stdio.h>
#include <stdlib.h>
int main() {
char prenom = 'A', nom = 'Z', tmp;
char *p_prenom = &prenom;
char *p_nom = &nom;
printf("vos initiales : %c.%c\n", prenom, nom);
tmp = *p_prenom;
prenom = *p_nom;
nom = tmp;
printf("vos initiales : %c.%c\n", prenom, nom);
return 0;
}