> make -s > ./main Original array contents: 9 1 1 1 1 1 1 1 1 1 Updated array contents: 191 1 1 101 1 1 63 1 1 21

icon
Related questions
Question
AHPA #10:
The Secure Array(use C programming)
• A programmer that you work with, Peter, is a jerk.
• He is responsible for an array [theArray] that is a key part of an important
program and he maintains a sum of the array values at location [0] in the array.
• He won't give you access to this array; however, your boss has told you that you
need to get input from the user and then place it into the array.
• Each evening Peter will scan the code and remove any illegal references to his
array.
• Using pointers, access Peter's array without him knowing it and place three
values that you got from the user (101, 63, 21) at locations 3, 6, and 9.
Recalculate the sum value and update it.
 
( the output should be same as the picture)
> make -s
> ./main
Original array contents:
9 1 1 1 1 1 1 1 1 1
Updated array contents:
191 1 1 101 1 1 63 1 1 21
Transcribed Image Text:> make -s > ./main Original array contents: 9 1 1 1 1 1 1 1 1 1 Updated array contents: 191 1 1 101 1 1 63 1 1 21
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution