Question: write a single c function called reset with the following prototype: void sum(int,int*); The second argument is an array of integers The first argument specifies

write a single c function called "reset" with the following prototype:

void sum(int,int*);

The second argument is an array of integers The first argument specifies how many integers are in that array

Your function should take the first element of the array and copy it to *all* elements of the array (a total of "len" arguments, where "len" is the value of the first argument). For example,

reset(5,data);

should replace all 5 elements of data with data[0].

Only modify as many integers as are specified by the first argument.

Put your function in a file named "reset.c" Make sure reset.c contains only your reset function, not a main function.

Test your code thoroughly, including the case where the first argument=0.

Then assess you code as follows:

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!