Question: int main ( ) { / / Create an array of ships Ship ships [ ] = { { Carrier , 0 ,
int main Create an array of ships Ship shipsCarrierBattleshipCruiserSubmarineDestroyer; b Copy the ships array to a new array called shipsnew Ship shipsnew; memcpyshipsnew, ships, sizeofships; c Modify shipsnew to reflect the changes Change the type of the Cruiser to "Destroyer" strcpyshipsnewtype, "Destroyer"; Change the old Destroyer to "Patrol Boat" strcpyshipsnewtype, "Patrol Boat"; Move the Submarine units in the y direction shipsnewy ; Print the modified shipsnew array for int i ; i ; i printfShip Type: s Position: dd
shipsnewitype, shipsnewix shipsnewiy; return ;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
