Question: Pointer variables are designed to hold addresses. Select a correct answer for the following code. int * getNum(){ int num1 = 0; num1 = num1+24;

 Pointer variables are designed to hold addresses. Select a correct answer

Pointer variables are designed to hold addresses. Select a correct answer for the following code. int * getNum(){ int num1 = 0; num1 = num1+24; return &num1;} The getNum() function above returns integer 24 back to the caller The getNum() function above returns a pointer back to the caller, and the pointer can be used by the caller to access num 1. None of the above is correct. The getNum() function returns the address of a variable that no longer exists

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!