Question: C Programming: Pointers Listed after the question is what results should look like after code is ran Write a program that takes the following array

C Programming: Pointers

C Programming: Pointers Listed after the question is what results should look

Listed after the question is what results should look like after code is ran

Write a program that takes the following array data (you can hard-code it in): array[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20} and uses a pointer to assist in displaying certain information about this array. The address of the pointer, the address referenced by the pointer, and the actual data stored at the referenced address should be outputted as shown in the following representative output. -The program should first prompt the user for one number from 1 to 4 . This number, the increment, determines how many array elements to jump at a time when printing. When the last possible element of the array is reached, the program should decrement back at the same rate to the beginning of the array. When incrementing, store the address of the array element into the pointer by indexing the array (e.g., ptr = \&array [i];). When decrementing, however, decrement the pointer itself (e.g., ptr =ptr1; ). -To scan in the increment value, you may use the getchar( ) function. However, realize that when a character is inputted, followed by the return key, the next getchar( ) function will retrieve the return character from the keyboard buffer. You can add an extra getchar( ) line to flush this return character from the buffer. You could also use scanf("%c%c",&ch); to throw away the return character from the input buffer. Also, based on the operating system, a "return" or "enter" might be read as a "line feed". Assume the user will only input one letter at a time (followed by the "return"/"enter"). Give me a jump-number from 1 to 4:G Error: the input MUST be a number from 1 to 4 . Give me a jump-number from 1 to 4:5 Error: the input MUST be a number from 1 to 4 . Give me a jump-number from 1 to 4:4 The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF10. The value stored at the referenced address is 1. The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF20. The value stored at the referenced address is 5. The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF30. The value stored at the referenced address is 9. The address of the pointer is 0022FFOC. The address referenced by the pointer is 0022FF40. The value stored at the referenced address is 13. The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF50. The value stored at the referenced address is 17. The address of the pointer is 0022FFOC. The address referenced by the pointer is 0022FF40. The value stored at the referenced address is 13. The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF30. The value stored at the referenced address is 9. The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF20. The value stored at the referenced address is 5. The address of the pointer is 0022FF0C. The address referenced by the pointer is 0022FF10. The value stored at the referenced address is 1. Press any key to continue

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!