Question: 1. Swap a) Write a function to swap two integers, and answer the following questions (you can have them answered in your comments, or in

1. Swap

a) Write a function to swap two integers, and answer the following questions (you can have them answered in your comments, or in your report preferably):

1) What's the return type of your swap function? Why?

2) What's the type of the arguments of your swap function? Why?

3) What's the meaning of * in your argument list?

4) For each line in your swap function code block: i. If there is a = operator involved, explain what the right value and what the left variable are.

i. If there is any involved, explain what it is for. (If * appearstwice in a ine, you need to have explanations for both)

5) How do you call the swap function (i.e. What do you pass as arguments for the function cal)? Why?

b) Write a function to swap two integer pointers, and answer the same questions in

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 Programming Questions!