Exercise
Explore memory allocation challenges by writing buggy C programs and using debugging tools like gdb and valgrind. Learn to detect and interpret memory errors such as invalid dereferences and leaks. Gain practical skills to improve your debugging proficiency in UNIX and C environments.
We'll cover the following...
In this exercise, you will gain some familiarity with memory allocation. First, you’ll write some buggy programs (fun!). Then, you’ll use some tools to help you find the bugs you inserted. Then, you will realize how awesome these tools are and use them in the future, thus making yourself more happy and productive. The tools are the debugger (e.g., gdb) and a memory-bug detector called valgrind
#include<stdio.h>
int main() {
printf("hello, world\n");
return 0;
}Note: You have to press the Run ...