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; +}