Add sos crash
This commit is contained in:
parent
f345891be9
commit
6a96eb957c
2 changed files with 17 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -36,3 +36,4 @@ strcmp
|
||||||
strlen
|
strlen
|
||||||
adresses-variables
|
adresses-variables
|
||||||
pointeurs
|
pointeurs
|
||||||
|
sos-crash
|
||||||
|
|
16
programmation-c-cpp/tp4/sos-crash.c
Normal file
16
programmation-c-cpp/tp4/sos-crash.c
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/* SOS crash */
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int age = 23;
|
||||||
|
int *pointeur_age = &age;
|
||||||
|
|
||||||
|
printf("Quel est votre âge ? ");
|
||||||
|
scanf("%d", pointeur_age);
|
||||||
|
|
||||||
|
printf("Vous avez %d ans\n", age);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue