From 6a96eb957c3b800ee21ff25ea6b88c51b5d268b4 Mon Sep 17 00:00:00 2001 From: "flyingscorpio@pinebookpro" Date: Mon, 15 Nov 2021 10:39:59 +0100 Subject: [PATCH] Add sos crash --- .gitignore | 1 + programmation-c-cpp/tp4/sos-crash.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 programmation-c-cpp/tp4/sos-crash.c diff --git a/.gitignore b/.gitignore index 2ac2b98..7bcf4fd 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ strcmp strlen adresses-variables pointeurs +sos-crash diff --git a/programmation-c-cpp/tp4/sos-crash.c b/programmation-c-cpp/tp4/sos-crash.c new file mode 100644 index 0000000..b7217af --- /dev/null +++ b/programmation-c-cpp/tp4/sos-crash.c @@ -0,0 +1,16 @@ +/* SOS crash */ + +#include +#include + +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; +}