Question: Write a function that creates a new variable on the stack. Give the variable a value of 3. Print out the value and the address
Write a function that creates a new variable on the stack. Give the variable a value of 3. Print out the value and the address of the variable within the function. Return the address of this variable, and make sure that main has a pointer set to the returned variable (int *x = func();
Print out the address of the variable and the value in the variable in main.Did this work?Did it compile?Include a comment on those 2 questions.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
