Write a program to compute the sum of all elements of an int array using only pointers. Correct the following program which issues a warning on compilation but fails at runtime. Does the create_array...


Write a program to compute the sum of all elements of an int array using only pointers.


Correct the following program which issues a warning on compilation but fails at runtime.


Does the create_array function return an array?


#include


short * create_array(void);


int main(void)


{


short i;


short *brr;


brr = create_array();


for (i = 0; i <>


printf(“%hd “, brr[i]);


return 0;


}


short * create_array(void)


{


short arr[ ] = {1, 3, 5, 7, 99, 88};


return arr;


}



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here