Question: 7.1 Task One (30%) A typical machine has an array of consecutively numbered or addressed memory cells that may be manipulated individually or in contiguous

 7.1 Task One (30%) A typical machine has an array of
consecutively numbered or addressed memory cells that may be manipulated individually or

7.1 Task One (30%) A typical machine has an array of consecutively numbered or addressed memory cells that may be manipulated individually or in contiguous groups. A pointer is a group of cells that can hold an address. The unary operator & gives the address of an object, so the statement p = &c assigns the address of c to the variable p, and p is said to "point to" c. The unary operator * is the indirection or dereferencing operator; when applied to a pointer, it accesses the object the pointer points to. According to these concepts, try to predict the output of the following code, and then type the code into your code IDE to verify your prediction #include void main() int x = 25, y = 50, z = 75; //Three int variables int *ptr; // Pointer variable //Display the contents of x,y, and 2. printf("Here are the values of x=%d, y=xd, and z-%d ",x,y,z); ptr - 8x; *ptr .=2; ptr - Xy; *ptr.2; ptr = 8z; *ptr.2; //display the contents of x, y, and 2. printf("After operations, Inthe values of x=%d, y=%d, and z=%d ",x,y,z); } 3.2 Task Two: Based on Application Exercises (P332- 333) 6.1. (35%) 6.2 Modify the program so that the input is read by calling a function named get_data(); The prototype of the get_data() function is: void get_data(int gal[], int size); while gal is an array to be used to pass the information in the array sewage_amt[100] and size is the total number of records. 3.3 Task Three : Based on Application Exercises (P332-333) 6.1-6.2 (35%) 6.3 Modify the program so that the output is displayed by calling a function display from the get_data() function. The prototype of the display() function is : void display( int * mil_gal, int array_size); while mil_gal is a pointer to be used to pass the information in the array sewage_amt[100] and array_size is the total number of records

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!