Question: Solve please 2. Write a C program to create dynamically allocated array of structures Ship. Number of the elements are entered by a user a.
2. Write a C program to create dynamically allocated array of structures "Ship". Number of the elements are entered by a user a. Implement program using following specification Structure "Ship" contains the fields: char Name [20], int length, int miles - Allocate memory for Array of structures dynamically (using malloc) - Ask user to enter size of array - Ask user to fill name, length and miles for each element of the array Write function that returns TRUE if each Ship in the array is longer than 20m, and FALSE otherwise. Function receives array and its size. Call this function in main and print result. Write a function that returns highest difference in miles between Ships in array Ask user to reduce size of array (enter a new size), using realloc function, and print array before and after reducing size b. c. d
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
