This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: * returns a pointer to the allocated storage; * / int * create_array(int n); /* destroys the array passed as argument * by releasing the memory occupied by it * / void release_array(int *a); /* Inserts new_element in array a at the proper position. * a is assumed to be sorted * n is the number of elements already inserted in a * After the insertion, a should be still sorted * All elements following new_element are shifted right * one position from their initial position * The function assumes that the storage allocated for a * is large enough to accomodate a new element */ int insert(int *a, int n, int new_element); The main function should create a dynamic array, insert 3 integers of your choice, print the second one in the array and release the array. 2...
View Full Document
- Summer '08
- typedef struct, int *a, dynamically allocated array