Question: We saw in lecture that array parameters are actually pointer parameters, which are passed by value and thus copied. However, we get behavior that makes
We saw in lecture that array parameters are actually pointer parameters, which are passed by value and thus copied. However, we get behavior that makes it seem like the "whole array" was passed by reference and not copied. Briefly explain this: Draw the state of memory as stack frames at the breakpoint labelled with a comment. int main(){int num1 = 42 int* num_ptr1 = &num1; int** ptr_ptr = &num_ptr1; int* num_ptr2 = num_ptr1; int num2 = 17; *ptr_ptr = &num2; ptr_ptr = &num_ptr2;//Breakpoint}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
