Question: Note: Lab submission must include all codes. Comments are must!! Each task needs at least a block comment ( and multiple single line comment )

Note: Lab submission must include all codes.
Comments are must!!
Each task needs at least a block comment (and multiple single line comment) explaining what's going on.
Task 1: Pointers and functions Must finish in lab
Subtasks:
Create two int pointers p1, and p2 in main.
Create a function called init1. This function will declare ain array of size n and will assign random values (if you want to make things easier, you can create a loop from i=0 to n, and assign the value of i to each element in the array). This function must return the array created in the function. Plus, the only argument of the function is n the length of the array.
Create a void function called init2. This function does exactly the same than init1, but I will not return anything. For this function, consider which parameters you need.
Assign an array to p1 and p2 using init1 and init2, respectively.
Finally, print the values (not the addresses) stored in p1 and p2.
Note: Lab submission must include all codes.

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!