Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Both declarations below create integer pointers. What reason did I give for preferring the second approach over the hrst one? What reason do some

image text in transcribed

1. Both declarations below create integer pointers. What reason did I give for preferring the second approach over the hrst one? What reason do some people give for preferring the first approach? ntp nt 2. Given the following code, what are some reasonable possibilities we could use to fill in the blank? int " 1e88); nt p 81 3. In the following chunk of code, if we want to execute the line y-&x, what should be the data type for y? cosble -3.14 4. (Synthesis) Push the limits of your pointer knowledge and synthesize new information by reasoning through this question: In the following code, if we want z to hold the address of p, what should its data type be? (Hint: It's not int z.) nt 1-56 5. Are the following ines of code valid, or is the assignment on line 3 problematic since p has not vet been initialized? int P 6. (Synthesis) Synthesize new knowledge: Given the following lines of code, how do you think you can use q to change the value stored in i? Write, compile, and execute a program to verify that your answer is corrett int 7. (Synthesis) Use pointers to write a swapi) function that takes the addresses af two variables and then swaps their values. By passing addresses to a function, you can use them to modify variables you created back in main! Here's the functional prototype as well as main include catdia.h //NetCQ that L'ahlving the dresses of E and j ta tha // swo nction. Therefore, swop() wd11 be one to NoH vorify that our sap functlon vorked

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions