diff --git a/20211209/crash-0.c b/20211209/crash-0.c new file mode 100644 index 0000000000000000000000000000000000000000..62d224512d44d55d34a532eb9fcc9ea14e443368 --- /dev/null +++ b/20211209/crash-0.c @@ -0,0 +1 @@ +main(){puts(0);} diff --git a/20211209/crash-1.c b/20211209/crash-1.c new file mode 100644 index 0000000000000000000000000000000000000000..d4f8b191d6d4491df2661046ce99c21ec2045a60 --- /dev/null +++ b/20211209/crash-1.c @@ -0,0 +1,7 @@ +#include <stdio.h> + +int main (void) +{ + printf (42); + return 0; +} diff --git a/20211209/crash-2.c b/20211209/crash-2.c new file mode 100644 index 0000000000000000000000000000000000000000..c0d5c0f5670234c45fa925a5b1d56e97b9de7a11 --- /dev/null +++ b/20211209/crash-2.c @@ -0,0 +1,9 @@ +#include <stdio.h> + +int main (void) +{ + printf ("Vor printf()\n"); + printf (42); + printf ("Nach printf()\n"); + return 0; +} diff --git a/20211209/crash-3.c b/20211209/crash-3.c new file mode 100644 index 0000000000000000000000000000000000000000..570685e33b61ac0ffdf4a38b8630b42759f325b1 --- /dev/null +++ b/20211209/crash-3.c @@ -0,0 +1,13 @@ +#include <stdio.h> + +void print_answer (int answer) +{ + printf ("Die Antwort lautet: "); + printf (answer); +} + +int main (void) +{ + print_answer (42); + return 0; +} diff --git a/20211209/crash-4.c b/20211209/crash-4.c new file mode 100644 index 0000000000000000000000000000000000000000..76ed93c6d097343be8c2f7f5591f8ec76892efd9 --- /dev/null +++ b/20211209/crash-4.c @@ -0,0 +1,18 @@ +#include <stdio.h> + +void print_answer (int answer) +{ + if (answer < 256) + { + printf ("Die Antwort lautet: "); + printf (answer); + } + else + printf ("Die Antwort ist zu kompliziert."); +} + +int main (void) +{ + print_answer (42); + return 0; +} diff --git a/20211209/crash-5.c b/20211209/crash-5.c new file mode 100644 index 0000000000000000000000000000000000000000..00e06ed3dbaaabb4ca5c935b3b1f4740354700ea --- /dev/null +++ b/20211209/crash-5.c @@ -0,0 +1,19 @@ +#include <stdio.h> + +void print_answer (int answer) +{ + if (answer == 42) + { + printf ("Die Antwort lautet: "); + printf (answer); + } + else + printf ("Die Antwort ist zu kompliziert.\n"); +} + +int main (void) +{ + for (int a = 0; a < 1000; a++) + print_answer (a); + return 0; +} diff --git a/20211209/crash-6.c b/20211209/crash-6.c new file mode 100644 index 0000000000000000000000000000000000000000..5f14383fe67e482aee32bb7d8f3f0345a894fef9 --- /dev/null +++ b/20211209/crash-6.c @@ -0,0 +1,23 @@ +#include <stdio.h> + +int s = 0; + +void print_answer (int answer) +{ + s += answer; + if (answer == 42) + { + printf ("Die Antwort lautet: "); + printf (answer); + } + else + printf ("Die Antwort ist zu kompliziert.\n"); +} + +int main (void) +{ + for (int a = 0; a < 1000; a++) + print_answer (a); + printf ("Die Summe der Antworten lautet: %d\n", s); + return 0; +} diff --git a/20211209/es-20211209.txt b/20211209/es-20211209.txt new file mode 100644 index 0000000000000000000000000000000000000000..9971aaf4ae6c29d300f478ad75390a30ad8b8eb0 --- /dev/null +++ b/20211209/es-20211209.txt @@ -0,0 +1,8 @@ +GNU-Debugger, 09.12.2021, 15:45:26 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + - Original-Dokumentation: + https://www.sourceware.org/gdb/documentation/ + + - Tutorial: + https://www.tutorialspoint.com/gnu_debugger/ + oder: Web-Suche nach: "gdb" "tutorial"