Question: Make memory diagrams for point 1 ( I included the one that I did, although i ' M not sure that's correct ) : #include

Make memory diagrams for point 1(I included the one that I did, although i'M not sure that's correct):
#include
void reverse(const int *source, int n, int* reversed, int* m);
int main(void)
{
int a[]={100,9,17,0,15};
int size_a;
int i;
int reversed[5];
int n;
size_a = sizeof(a)/ sizeof(a[0]);
printf("a has %d elements:", size_a);
for (i =0; i size_a; i++)
printf("%d", a[i]);
printf("
");
reverse(a, size_a, reversed, &n);
printf("reversed values from a:");
for (i =0; i n; i++)
printf("%d", reversed[i]);
printf("
");
return 0;
}
void reverse(const int *source, int n_source,
int* reversed, int* m)
{
int i;
*m =0;
for (i = n_source -1; i >=0; i--){
reversed[*m]= source[i];
(*m)++;
}
printf("%d",*m);
/* point one (NOTE: This is *outside* of the for loop.)*/
}
 Make memory diagrams for point 1(I included the one that I

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!