Question: This is in C. The program is supposed to be called bounds.c. Write a small program called bounds that allocates memory for 100 integers (sizeof(int)
This is in C. The program is supposed to be called bounds.c.
Write a small program called bounds that allocates memory for 100 integers (sizeof(int) * 100) using malloc() and saves the pointer from malloc() in a pointer variable called ptr. Then set ptr[100] = 0 and see what happens when you run this program. make bounds will compile your code and run valgrind. Review the valgrind report. Run the program manually to see if it crashes.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
