Checkpoint 2.4.1. Dynamic Memory Allocation.
- They are different sizes.
- No. Both
arr2can hold up to 10 int elements.
arr1is allocated in stack memory, while
arr2is allocated in heap memory.
arr1stores ints, while
arr2stores pointers to ints.
- Incorrect. Read the code again carefully!
- Incorrect. Neither array contains any values.
What is the difference between
arr2, defined as follows?
int arr1; int *arr2; arr2 = (int *) malloc(sizeof(int) * 10);